Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Feb 2006
    Posts
    149
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Displaying users online

    Hello and good after noon ,

    I want to be able to display all users browsing my site on the right navigation of my site.

    I have one header that is included on every page of my site so I am guessing i will need to place the code that counts a person there, and that would be no problem.

    I need a code to count people which will go in my header

    and a code that will display people which will go in my navigation menu

    any help on this subject is greatly appriciated, thanks in advance

  • #2
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It can be done in different ways.

    One way is to have a dedicated session table.
    When a user logs in a session is created and that ID is inserted into the database with a last_active time.

    You can then check against this table to count the number of users. You can also do some joins to get their user name, level etc.
    And you can also check against the last_active time. If it is not within 15 mins then you can assume the session has ended and delete the session.

  • #3
    Regular Coder
    Join Date
    Feb 2006
    Posts
    149
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the reply

    would anyone be able to tell me how to accomplish this

    thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •