So I was bored and decided to make a better server status
CREDITS GOES TO DEFAULT For Making the orignal status
And me for coding and improving it.
Serverstatus.php
PHP Code:
<title>Pokenet Server Status</title>
<?php
include('config.php'); //include Configuration
echo("<center><h4>$name Server Status</h4></center>");
echo "<hr>";
//Check if Port 7002 is open
error_reporting(0);
function check_server_status($ip,$name) //create some sort of custom function
{
$server=fsockopen($ip,"7002",$errno,$errstr, 2);
if(!$server)
{
echo "<h3>$name is <font color=red>Offline</font></h3>";
fclose($server);
}
else
{
echo"<h3>$name is <font color=green>Online ! </font></h3>";
fclose($server);
}
}
check_server_status($ip,$name);
?>
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<center><h6><?php echo $name ;?> Entertainment
<br />Copyright <?php $name ;?> 2011 All Rights Reserved </h6></center>
config.php (THIS IS IMPORTANT BECAUSE THE ABOVE FILE RELIES ON THIS)
PHP Code:
<?php
#SERVER Status Configuration
$ip="127.0.0.1"; //Place your I.P HERE
$name="Test Server"; //Place your Server Name Here
?>
Shouldnt output any errors. just edit the config and your good to go.