Homepage - Status.inc.php error

06/05/2015 07:55 zeimpekis1998#1
Hello guys, i made a new server and now i translate and fix my homepage script. But i have in the folder 'inc' a file with name 'status.inc.php' . I put the right ip and right ports there but when i put to my website it continues to show me 'Offline'. Can you help me?
06/05/2015 12:51 timonick#2
Das gleiche Problem hab ich auch. Hab das offline einfach in Online ersetzt, aber jetzt steht da halt immer Online :D
06/05/2015 15:17 Aerociety#3
Soweit ich weiß benutzt dieses Skript die PHP-Sockets diese sind meistens nicht installiert
und Fehler werden unterdrückt (nicht angezeigt) daher siehst du nur Offline

php-net-socket - PHP PEAR Network Socket Interface module - Das solltest du installieren

MfG
06/05/2015 17:32 zeimpekis1998#4
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>
06/05/2015 18:01 Aerociety#5
Quote:
$online = @fsockopen($ip, $port, $errno, $errstr, 1);
Your script uses @ which disabels any error output, try to install php-net-socket (which is not installed by default)

greets
06/05/2015 18:34 iShiney#6
can you upload ?