Dynamic Online users count PHP code?

It wouldn't matter "Dynamic users online count"

Auto updates without refreshing page.
PHP alone wouldn't do this. And yes it does matter what kind of server you are running. Are you running an oldskool server, like debbo? or are you running a server that requires an emulator and uses .swfs and MySQL? If you are running a server that uses MySQL, then you can use Javascript to loop through and refresh the online count. But that would be a big load on the webhost.
 
Upvote 0
PHP alone wouldn't do this. And yes it does matter what kind of server you are running. Are you running an oldskool server, like debbo? or are you running a server that requires an emulator and uses .swfs and MySQL? If you are running a server that uses MySQL, then you can use Javascript to loop through and refresh the online count. But that would be a big load on the webhost.

Wrong php could do this if I remember.
 
Upvote 0
Wrong php could do this if I remember.
?? Not wrong. I develop websites for money. I am pretty advanced with PHP. PHP has never been able to update text on a website without a page reload. I would use jQuery (Javascript Library) to send an AJAX call to a PHP update script, and set the online count to that value via jQuery.
 
Upvote 0
I coded this just for you :)
Like me if it works,
if not, ill re-code it


$onlineurl = file_get_contents('ONLINE LINK HERE'); // T.EX blablabla.com/online.php? lol$result = mysql_query("SELECT * FROM server_status");$online = "Users Online!";$row = mysql_fetch_array( $result ); $image = imagecreatefrompng('images/banner.png'); $font_color = imagecolorallocate($image, 255, 0, 0); imagefttext($image, 20, 0, 417, 30, $font_color, './arial.ttf', $row['users_online']); imagefttext($image, 8, 0, 398, 45, $font_color, './arial.ttf', $online); imagefttext($image, 20, 0, 394, 77, $font_color, './arial.ttf', $num_rows); header('Content-type: image/png'); imagepng($image); imagedestroy($image);
 
Upvote 0
I coded this just for you :)
Like me if it works,
if not, ill re-code it


$onlineurl = file_get_contents('ONLINE LINK HERE'); // T.EX blablabla.com/online.php? lol$result = mysql_query("SELECT * FROM server_status");$online = "Users Online!";$row = mysql_fetch_array( $result ); $image = imagecreatefrompng('images/banner.png'); $font_color = imagecolorallocate($image, 255, 0, 0); imagefttext($image, 20, 0, 417, 30, $font_color, './arial.ttf', $row['users_online']); imagefttext($image, 8, 0, 398, 45, $font_color, './arial.ttf', $online); imagefttext($image, 20, 0, 394, 77, $font_color, './arial.ttf', $num_rows); header('Content-type: image/png'); imagepng($image); imagedestroy($image);

That is PHP & you didnt code that you took that from a thread on here, that's a dynamic users online banner.
 
Upvote 0
Back