Question

06/09/2009 17:23 dibiase#1
How do i display how many players are online?

the following code does NOT work:
Code:
mysql_select_db($mydbacc);
$res = mysql_query("SELECT count(*) FROM account WHERE online = 1");
$val = mysql_fetch_array($res);
echo "Total Characters Online: ".$val[0]."<br />";
I need the correct code please.
thanks
06/10/2009 08:41 hio77#2
really you cant .... that will show weather they are banned or not :P
06/10/2009 10:34 Spy520#3
Here you go [Full Credits goes to Forcer]
Quote:
Originally Posted by forcer View Post
PHP Code:
Online Players: <b><?php echo (exec('netstat -a -n |find "5816"  |find "ESTABLISHED" /c')-2); ?></b><br />
adding this to your index.php should show Online players.

Regards
Spy520
06/10/2009 10:59 hio77#4
Quote:
Originally Posted by Spy520 View Post
Here you go [Full Credits goes to Forcer]



Regards
Spy520
just too warn you that will only work if the site is hosted on the local system ...


there is a remote way of running it i will work out how to use it correctly and show you if you would like ^_^
06/10/2009 13:57 Spy520#5
Yeh it will be so nice as now adays no one use Apache , All use free hosting like freehostia.com so we need it really fast hio77 , Thanks
06/10/2009 21:09 dibiase#6
Thanks, my website is on my computer so that should work ^_^ thanks spy
06/11/2009 00:37 commandcom#7
i remember i made it with [Only registered and activated users can see links. Click Here To Register...] functions(Game server online.txt) but im lazy to make an example for you
study some php so it make sense for you
06/11/2009 06:28 hio77#8
Quote:
Originally Posted by Spy520 View Post
Yeh it will be so nice as now adays no one use Apache , All use free hosting like freehostia.com so we need it really fast hio77 , Thanks
i know how too .... been reading up on it but i haven't tested yet .... free webhosts suck ... i pay for all my web hosting separate from the server so the server purely dose the server no site data .... other than torrenting the client ....