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

    How to do '# number of users online'

    I have a simple PHP session based forum, which I've built. I'm really keen to display one of those panels listing how many users are currently online.

    It's done on this forum as 'Currently Active Users:'

    How is this achieved using PHP?

    Do you perhaps store something in a file or database whenever someone logs in and then check, remove it when they log out or are timed out?

  • #2
    Senior Coder
    Join Date
    Aug 2003
    One step ahead of you.
    Thanked 3 Times in 3 Posts
    You search session data to see which users are currently active. It's best to store the session data in a database as that will make searching easy.
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.


    Posting Permissions

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