Forum Moderators: coopster
PHP:--------------------------------------------------
<html>
<?php
include "./admin/config.inc.php";
mysql_connect($db_host,$db_user,$db_pass);
// login into the mysql database server
mysql_select_db($db_name);
// select the site's database
$query = mysql_query('SELECT * FROM games');
// get all the information in the 'ganes' table
while($games = mysql_fetch_array($query)) {
echo "<b>" . $games['Title'] . "</b>";
echo "<br>";
echo "<img src=" . "'" . $games['Picture'] . "'" . "border=0>";
echo "<br>";
//Turns off error reporting so that connection errors are ignored.
error_reporting(0);
$fp = fsockopen ($games['IP'], $games['Port'], $errno, $errstr, 2);
stream_set_timeout($fp, 1);
fclose($fp);
//Turns error reporting back on to default .ini value
error_reporting(E_ALL ^ E_NOTICE);
if ($fp == true) {
echo "<font color=green>";
echo "<b>" . "Server Up" . "</b>";
echo "</font>";
}
else {
echo "<font color=red>";
echo "<b>" . "Server Down" . "</b>";
echo "</font>";
}
echo "<br>";
echo $games['IP'] . ":" . $games['Port'];
echo "<br>";
echo "<a href=" . "'" . $games['Website'] . "'>" . $games['Website'] . "</a>";
echo "<br>";
if ($games['ModsRunning'] == 1) {
echo "This server is running the following mods-";
echo "<br>";
echo $games['Mods'];
}
else {
echo "This server is not running any mods.";
}
echo "<br>";
if ($games['MaxPlayers'] <> 0) {
echo "Max Players: " . $games['MaxPlayers'];
}
else {
echo "Max Players: " . "Unknown";
}
echo "<br>";
echo $games['ExtraInfo'];
echo "<hr>";
}
?>
</html>