PhP? oO

09/30/2011 11:53 taZツ#1
Seems like i failed a bit with this php code:

It shows when the port is used as ONLINE. but when i close the port it shows OFFLINE with this error:

I was wondering if someone could get it fixed, since i tryed couple of ways to do it and no succes.
09/30/2011 12:19 RebeccaBlack#2
Eh? What is it for? Since localhost you don't need to keep it trying that long. Do like:
PHP Code:
<?php
error_reporting
(0);
$fp fsockopen("127.0.0.1","30800",$errno,$errstr,1);
if(!
$fp)
{
echo 
"<span style=\"color: #AA0E0E; font-weight: bold;\">Offline</span> Server will be back soon!";
}
else
{
echo 
"<span style=\"color: #41AA0E; font-weight: bold;\">Online</span>";
$onl=false;
}
fclose($fp);
?>
09/30/2011 13:23 taZツ#3
Thank you RebeccaBlack, you just solved my problem.