<?PHP
$ip=gethostbyname($host);
$result=ping -n 1 -l 1 $ip;
$a = strpos ($result, "ms");
if (!$a) {
echo "Offline";
} else {
echo "Online<br>Port status: ";
if (!fsockopen ($host, 27015, &$errno, &$errstr, 30)) {
echo $errno." (".$errstr.")";
} else {
echo "Online";
}
}
?>
it doesnt work.. i try a web server ips, and with port 80 and it returns online
but i try an ip which i am 100% SURE that port is open and i get 9 (Bad file descriptor) .... (im talking bout port 27015)