// This function check the port status and return true (online) or false (offline)
function is_online($server='localhost',$port=80,$timeout=2) {
$fp = @fsockopen($server, $port, &$errno, &$errstr, $timeout);
if (!$fp)
echo "Offline";
mail(BLABLABLA)
else
{
fclose($fp);
echo "Online";
}
}
?>
@@HTTP