PHP Server Status
On the page you want to put the server status, put this code:
PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
<?php
$churl = @fsockopen("IPADDRESS", PORT, $errno, $errstr, 5);
if(!$churl)
{
$statusMSG = "OFFLINE MESSAGE";
}
else
{
$statusMSG = "ONLINE MESSAGE";
}
?>
Change IPADDRESS to the IP address of the server, PORT to the port the server is running on, OFFLINE MESSAGE to the message you want to be shown when the server is offline (can be HTML), and ONLINE MESSAGE to the message you want to be shown when the server is online (can be HTML).
Then, where you want the message to appear, put this:
PHP Code
<?php echo $statusMSG; ?>
Hope you like it!