Dynamic Online users count PHP code?

Results 1 to 10 of 10
  1. #1
    Member Cloudflare is offline
    MemberRank
    Jun 2012 Join Date
    43Posts

    Dynamic Online users count PHP code?

    Title says it all.


  2. #2
    Newbie NathanTaylor207 is offline
    MemberRank
    Feb 2013 Join Date
    Maine, USALocation
    9Posts

    Re: Dynamic Online users count PHP code?

    I think we would need a little more information on what you are looking for. What kind of server are you running? And what CMS are you using?

  3. #3
    Member Cloudflare is offline
    MemberRank
    Jun 2012 Join Date
    43Posts

    Re: Dynamic Online users count PHP code?

    Quote Originally Posted by NathanTaylor207 View Post
    I think we would need a little more information on what you are looking for. What kind of server are you running? And what CMS are you using?
    It wouldn't matter "Dynamic users online count"

    Auto updates without refreshing page.

  4. #4
    Newbie NathanTaylor207 is offline
    MemberRank
    Feb 2013 Join Date
    Maine, USALocation
    9Posts

    Re: Dynamic Online users count PHP code?

    Quote Originally Posted by Cloudflare View Post
    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.

  5. #5
    Member Cloudflare is offline
    MemberRank
    Jun 2012 Join Date
    43Posts

    Re: Dynamic Online users count PHP code?

    Quote Originally Posted by NathanTaylor207 View Post
    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.

  6. #6
    Newbie NathanTaylor207 is offline
    MemberRank
    Feb 2013 Join Date
    Maine, USALocation
    9Posts

    Re: Dynamic Online users count PHP code?

    Quote Originally Posted by Cloudflare View Post
    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.

  7. #7
    Member Cloudflare is offline
    MemberRank
    Jun 2012 Join Date
    43Posts

    Re: Dynamic Online users count PHP code?

    Quote Originally Posted by NathanTaylor207 View Post
    ?? 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.
    Hmmmm alright.

  8. #8
    lol Disguised is offline
    Grand MasterRank
    Jan 2011 Join Date
    521Posts

    Re: Dynamic Online users count PHP code?

    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);

  9. #9
    Newbie NathanTaylor207 is offline
    MemberRank
    Feb 2013 Join Date
    Maine, USALocation
    9Posts

    Re: Dynamic Online users count PHP code?

    That is all PHP, there is no way that is going to by dynamic and update every time someone logs into the hotel.

  10. #10
    Member Cloudflare is offline
    MemberRank
    Jun 2012 Join Date
    43Posts

    Re: Dynamic Online users count PHP code?

    Quote Originally Posted by Disguised View Post
    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.



Advertisement