Find the answer to your Linux question:
Results 1 to 3 of 3
I've seen loads of posts over the years asking how to count the number of users online. I came across this today. http://www.devarticles.com/c/a/PHP/T...line-With-PHP/ I'll sumarise. use sessions. count number of ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Jan 2003
    Location
    Cardiff, Wales
    Posts
    478

    HOWTO: Count users online


    I've seen loads of posts over the years asking how to count the number of users online.

    I came across this today.
    http://www.devarticles.com/c/a/PHP/T...line-With-PHP/

    I'll sumarise. use sessions. count number of files in the session directory.

    that's it. no detailed info about users but it is fast and simple.
    No trees were harmed during the creation of this message. Its made from a blend of elephant tusk and dolphin meat.

  2. #2
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284
    thats a pretty cool way of doing it. I belive phpBB which this site uses stores the sessions in a database, so to workout who is online just use a select query with a count(*) where the last access time was within 5 minutes or whatever.

    Jason

  3. #3
    Linux User
    Join Date
    Jan 2003
    Location
    Cardiff, Wales
    Posts
    478

    phpbb

    yes. I think that's right. but creating a system like that could become very complex.
    not to mention the access speed could become very slow (in relative terms) as the table fills up. so you would need some procedures for purging it every so often.

    I just liked the simplicity of this method. but it is definatly not applicable to all uses. it will do what it says on the tin. and no more.
    No trees were harmed during the creation of this message. Its made from a blend of elephant tusk and dolphin meat.

Posting Permissions

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