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? Link to comment https://forums.phpfreaks.com/topic/277463-function-pinghost/ 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? Link to comment https://forums.phpfreaks.com/topic/277463-function-pinghost/#findComment-1427767 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.