### Users Online



I have made my own user login system for my site and its working great but.... I want to have an "active users list". I was thinking something like having all logged in users send a variable to the server so that the server generates the list or something like that. Could somebody tell me basically what I'll have to do to make an "active users list"?
Well, PHP doesn't support server side variables like ASP, so you're going to have to do it with a database or something. Every time someone accesses a page, enter the session ID and time into the database. Then to find out how many people are online you just count how many distinct session ID's there are in the last X minutes! That's the general gist, you'll have to develop your own method depending on how your site works.

On mine I log everything, so I can tell where people are, how many people visiting a particular page, and a particular version ('cos different variables generate different pages), how many registered, etc etc etc! Start off small, and then built it up as you go on!
Good Idea, I'll hook it in to my MySQL database... Whats your site Jay?
Xerpher said:
Good Idea, I'll hook it in to my MySQL database... Whats your site Jay?
Tailored Mobile, but it's still a work in progress! If you want to see the stats, look at the source coding and it's right at the bottom! Also the site doesn't look like that much when you look at it, but a lot of the processing is done on the backend. The menus etc dynamically generate themselves!
Xerpher said:
Nice site, I like the "Info - Text Files" link :D
Thanks, it's more or less done now, I just can't find the time to complete it!