I am trying to make a server status page for my game server and the code ends up not showing if the server is online.
<?PHP
$ts_ip = "177.82.148.141";
$ts_port = "2505";
$output = @fsockopen("$ts_ip", $ts_port, $errno, $errstr, 2);
stream_set_timeout($output, 00002);
if (!$output) {
echo "<FONT COLOR=#DD0000><B>FEB Offline</B></FONT>";
} else {
echo "<FONT COLOR=#00DD00><B>FEB Online</B></FONT>";
}
@fclose($output);
?>
It also gives me this error:
Warning: stream_set_timeout() expects parameter 1 to be resource, boolean given in /home/u918484727/public_html/teste.php on line 6
May someone help me?