here this will help ya:
Code:
<?php
require ("connect.php");
$res = mysql_query("SELECT count(*) FROM accounts;");
$val = mysql_fetch_array($res);
echo "<div style='top'><font color='white'>Accounts Created: ".$val[0]."</div>";
$res = mysql_query("SELECT count(*) FROM characters;");
$val = mysql_fetch_array($res);
echo "<div style='top'><font color='white'>Characters Created: ".$val[0]."</div>";
$ip = "Your Server Ip";
$port = "9958"; //keep this what it is!!
if (! $sock = @fsockopen($ip, $port, $num, $error, 5))
echo "<body bgcolor='black'><font color='white'>Server: </font><B><FONT COLOR=red>Offline</b></FONT>";
else{
echo "<body bgcolor='black'><font color='white'>Server: </font><B><FONT COLOR=lime>Online</b></FONT>";
fclose($sock);
}
$res = mysql_query("SELECT count(*) FROM accounts WHERE online=1;");
$val = mysql_fetch_array($res);
echo "<div style='top'><font color='white'>Total Players Online: ".$val[0]."</div>";
?>
Then make a connect.php
Code:
<?php
$error = "<body bgcolor='black'><font color='white'>Problem connecting to database, Please try again later.</font>";
$connect = mysql_connect("localhost", "root", "password") or die($error);
mysql_select_db("coproj") or die($error);
?>