View Full Version : How to do '# number of users online'

08-04-2007, 04:29 AM
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?

08-04-2007, 01:14 PM
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.