Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   make ping with PHP (http://www.go4expert.com/forums/ping-php-t14439/)

guif 8Oct2008 14:41

make ping with PHP
 
I would like to make a simple monitoring. I make this:

Code:

<?php
$ip = $_SERVER['127.0.0.1'];
exec("ping -n 4 $ip 2>&1", $output, $retval);
if ($retval != 0) {
echo "no!";
}
else
{
echo "yes!"; }
?>

I use my internal IP: 127.0.0.1.
The result is: NO!

why???

asha 17Oct2008 10:35

Re: make ping with PHP
 
What platform are you running the script on?


All times are GMT +5.5. The time now is 05:53.