Newbie Spellweaver
- Joined
- Jan 18, 2005
- Messages
- 43
- Reaction score
- 0
Save with the name status.php
PHP:
<?php
error_reporting(0);
$IP = array(
"Login Server:" => "YourServerIP:2106",
"Game Server:" => "YourServerIP:7777",
);
echo "<center><table><tr>";
while(list($ServerName,$Host)=each($IP)) {
list($IPAddress,$Port)=explode(":",$Host);
echo "<td>$ServerName</td>";
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5)) {
echo "<td><font color=green><b>Online</b></font></td>";
fclose($fp);
**
else {
echo "<td><font color=#ff0000><b>Offline</b></td>";
**
echo "</tr>";
**
echo "</table></center>";
?>