so we just copy this code into a new file and save it as something like "status.php" and edit the SERVER IP + PORT part? do we leave the quotatioins or not?
edit: i left the quotes and its not working. how do we add/rename servers because mine still isn't working...
Code:
<?
error_reporting(0);
$IP = array(
"Login Server" => "70.85.87.52:80",
); while(list($ServerName,$Host)=each($IP)) {
list($IPAddress,$Port)=explode(":",$Host);
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR _STR,(float)0.5)) {
echo("<font color=\"white\"><b>Login Server</b> - <font color=\"green\"><b>Online</b></font>");
fclose($fp);
}
else {
echo ("<font color=\"black\"><b>Login Server</b> - <font color=\"red\"><b>Offline</b></font>");
}
echo ("");
}
?>
<p></p>
<?
error_reporting(0);
$IP = array(
"Map Server" => "70.85.87.52:80",
); while(list($ServerName,$Host)=each($IP)) {
list($IPAddress,$Port)=explode(":",$Host);
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR _STR,(float)0.5)) {
echo("<font color=\"white\"><b>Map Server</b> - <font color=\"green\"><b>Online</b></font>");
fclose($fp);
}
else {
echo ("<font color=\"black\"><b>Map Server</b> - <font color=\"red\"><b>Offline</b></font>");
}
echo ("");
}
?>
<p></p>
<?
error_reporting(0);
$IP = array(
"Char Server" => "70.85.87.52:80",
); while(list($ServerName,$Host)=each($IP)) {
list($IPAddress,$Port)=explode(":",$Host);
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR _STR,(float)0.5)) {
echo("<font color=\"white\"><b>Char Server</b> - <font color=\"green\"><b>Online</b></font>");
fclose($fp);
}
else {
echo ("<font color=\"black\"><b>Char Server</b> - </font><font color=\"red\"><b>Offline</b></font>");
}
echo ("");
}
?>