Page 1 of 1

### Users Online

Posted: Thu Sep 05, 2002 1:36 pm
by Xerpher
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"?

Posted: Thu Sep 05, 2002 2:16 pm
by Jay
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!

Posted: Thu Sep 05, 2002 4:30 pm
by Xerpher
Good Idea, I'll hook it in to my MySQL database... Whats your site Jay?

Posted: Fri Sep 06, 2002 1:58 am
by Jay
Xerpher wrote: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!

Posted: Fri Sep 06, 2002 3:32 am
by Xerpher
Nice site, I like the "Info - Text Files" link :D

Posted: Sat Sep 07, 2002 1:39 am
by Jay
Xerpher wrote: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!