You could use this easy function snippet:
PHP Code:
<?php
// Returns value 0 (Server is offline) or 1 (Server is online)
// ex.:
// if(Serverstatus("127.0.0.1", "80") == 0)
// {
// echo "Offline";
// }
// else
// {
// echo "Online";
// }
function Serverstatus($ip, $port)
{
$con = @fsockopen($ip, $port, $errno, $errstr, 1);
if(!$con)
{
fclose($con);
return 0;
}
else
{
fclose($con);
return 1;
}
}
?>
Example for trying to access Zone 1:
PHP Code:
<?php
if(Serverstatus("YOUR SERVERIP", "9120") == 0)
{
echo "Zone 1 is offline!";
}
else
{
echo "Zone 1 is online!";
}
function Serverstatus($ip, $port)
{
$con = @fsockopen($ip, $port, $errno, $errstr, 1);
if(!$con)
{
fclose($con);
return 0;
}
else
{
fclose($con);
return 1;
}
}
?>