Posted: Mon May 01, 2006 11:36 am
So you can ping IP's external to your local network but you can't ping local network addresses?
Sounds like a routing problem.
Sounds like a routing problem.
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$ip = $row_records['IP'];
if($ip == "Not Available"){
echo 'Offline';
}else{
$status = exec("ping -n 1 $ip", $output);
$arr = explode(", ", $status);
if($arr[1] == "Received = 0"){
echo "Offline";
}else{
echo "Online";
}
}orMinimum = 0ms, Maximum = 0ms, Average = 0ms
So I did an array. If it "Recieved" nothing, it's Offline. However, it STILL displays 'Online'. My head is hurting. ~.~Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),
Code: Select all
$ip = $row_records['IP'];
if($ip == "Not Available"){
echo 'Offline';
}else{
$status = exec("ping -n 1 $ip", $output);
if(strpos($status, "100% loss") === false)
echo "Online";
else
echo "Offline";
}That was because you were making Received = 0 and it could well receive 1. Am I right?So I did an array. If it "Recieved" nothing, it's Offline. However, it STILL displays 'Online'. My head is hurting