NIC ping patch for Win32
Michael Cochrane
mike@graftonhall.co.nz
Wed, 8 Aug 2001 14:18:34 +1200
Here is the change I made to ping.php to allow it to work in a win32 system.
I have tested this and it works fine on my Windows 2000, Apache system.
Could someone commit this to the CVS tree if no problems are found with it.
if (stristr(php_uname(),"Windows")) {
exec("ping -n 5 -w 3000 $addr", $ping);
// $i=1 to reduce the number of blank lines
for ($i=1; $i<count($ping); $i++) {
$results.= "<BR>$ping[$i]\n";
}
} else {
exec("/bin/ping -c 5 $addr", $ping);
for ($i=0; $i<count($ping); $i++) {
$results.= "<BR>$ping[$i]\n";
}
}
Cheers
Mike