FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a 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
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

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