dexterbb Posted April 30, 2013 Share Posted April 30, 2013 Hey guys, I'm trying to show a few ips are online or not, but the return is always as online. The function I'm trying to use is the one below: <?php function ping($host) { $conectado = fsockopen($host, 80, $numeroDoErro, $stringDoErro, 255); if ($conectado) { return true; }else{ return false; fclose($conectado); } } ?> The variable $host receives an ip like this: 172.16.10.50 I'm calling the function like this: $ping = ping($dados[ip]); I need some extra configuration to work properly? Quote Link to comment Share on other sites More sharing options...
dexterbb Posted May 2, 2013 Author Share Posted May 2, 2013 Even pinging the host for the shell/cmd and seeing that he is inaccessible, the above function tells me that is accessible. Could someone give me a light? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.