Ive looked all over the internet for a simple script to show the server status on my PHP-Nuke website (
http://here2obliterate.com ).
I found one that works pretty good but I had to do some major editing to the script in order to show all 3 servers ( login, char, and map ).
I got it working and it worked like a charm. But now for some reason, it keeps showing that the servers are offline even though I can get on the server. I have checked the port forwarding, refreshed page, closed browser and reloaded page with both IE and Firefox, but it still shows that its offline.
Does anyone know how to fix it or have any suggestions for a better one that works?
Also, ratemyserver.net has a server status and it works for my server showing that its Online. Is it possible for me to get that script/files?
Heres what im using right now that doesnt work anymore:
<?php
$live = "live.gif";
$dead = "dead.gif";
$link = $_GET['link'].":";
$s_link = str_replace("::", ":", $link);
list($addr,$port)= explode (':',"$s_link");
if (empty($port)){
$port = 6900;
}
$churl = @fsockopen(server($addr), $port, $errno, $errstr, 20);
if (!$churl){
//echo $errstr;
header("Location: $dead");
}
else {
header("Location: $live");
}
function server($addr){
if(strstr($addr,"/")){$addr = substr($addr, 0, strpos($addr, "/"));}
return $addr;
}
?>
And i have 3 versions of this file ( one for each port ) on my website.
Then I use this HTML code to show it:
<tr>
<td><font>Login</font></td>
<td><img src="login_status.php?link=66.57.29.197"></td>
</tr>
And I have 2 more using the 3 different files: login_status.php , char_status.php , map_status.php
And I have 2 pictures (red and green poring) showing that its online or ofline.
It used to work but now it doesnt.
So can anyone get me a script that works better or tell me how to fix this?