This is my script:
<!-- Online/Offline Status -->
<div class="online-status">
<?php
$ip = "-----";
$portlist=array(13000,13001,3306,11002); // Den port den ihr sehen wollt
$status=array("Channel 1:", "Channel 2:", "Mysql:", "Login Server:"); // Bezeichnung
$i=0;
echo '<table><tbody>';
foreach ($portlist as $port){
$online = @fsockopen($ip, $port, $errno, $errstr, 1);
if ($online)
{
echo '<tr><td style="height:25px;width:125px;">'.$status[$i].'</td><td style="height:25px;"><span style="color:green;">Online</span></td></tr>';
/*echo ' <img src="./images/status_line.png">';*/
}
else
{
echo '<tr><td style="height:25px;width:125px;">'.$status[$i].'</td><td style="height:25px;"><span style="color:red;">Offline</span></td></tr>';
}
@fclose($online);
$i++;
}
$result1 = mysql_fetch_assoc(mysql_query("SELECT COUNT(id) AS count FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 5 MINUTE) < last_play"));
$result2 = mysql_fetch_assoc(mysql_query("SELECT COUNT(id) AS count FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 24 HOUR) < last_play"));
$accs = "SELECT id from account.account";
$accsquery = mysql_query($accs);
$accszahl = mysql_num_rows($accsquery);
echo '<tr><td style="height:25px;width:125px;">Channel 1:</td><td style="height:25px;"><span style="color:green;">Online</span></td></tr>';
echo '<tr><td style="height:25px;">Λογαριασμοί:</td><td style="height:25px;">' . $accszahl . '</td></tr>';
echo '<tr><td style="height:25px;">Συνδεδεμένοι Παίχτες:</td><td style="height:25px;"> '.$result1['count'].'</td>';
echo '</table></tbody>';
?>
</div><div class="clear"></div>