PhP "server status" script
Posted: Wed Dec 23, 2009 4:49 pm
Okay.. so I've recently designed a script that essentially use for server status:
Any questions, advice, tips, etc you may direct to me via this thread.
Code: Select all
/////////////////////////////////
///// Copyright © 2009 /////
///// Orbit Storm & Bloodcraft /////
///// Server Status Script /////
///////////////////////////////
<?php
$server_ip = ""; //Place your server's IP address inside the quotes.
$server_port = ; //Place your server's port number one space after the equal sign.
$x = "The server is: ";
if(fsockopen($server_ip, $server_port, $errno, $errstr, 30))
{
$x .= "<b style=\"color:green;\">Online</b>."; //You may add an "online" image in place of the plain text format.
}
else
{
$x .= "<b style=\"color:red;\">Offline</b>."; //You may add an "offline" image in place of the plain text format.
}
echo $x;
?>