FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Server Status





yimaw
Code:
<?PHP
function serverstatus($host, $port) {
  $sock = @fsockopen($host, $port, &$num, &$error, 2);
  if ($sock) {
      if (getservbyport($port,"tcp")!=null) {
          $serv = getservbyport($port,"tcp");
      } else {
          $serv = "Unknown";
      }
      echo "<center>Server : <span style='color:green'>Online</span></center>";
      fclose($sock);
      unset($sock);
  }else{
      echo "<center>Server : <span style='color:red'>Offline</span></center>";
      unset($sock);
  }
}

//Ports To Scan
serverstatus("68.100.166.101", 4000);

//Dark Dragon
?>


this is a script that tells if a server is on or off
Related topics
Checking Server Status, Ping a Server (lots of purposes)
Home Server Status Indicator
[RESOLVED] Server Load
Server Status.
Server Status
Server status script
Frihost server status checker
Checking server status (ports) using PHP
Current server status
New Server Status page
How about adding server load to the server status script?
Server Status & Server 3
Server Status Page? Coming back anytime soon?
Is there new Server Status Gif
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.