### Users Online

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Xerpher
New php-forum User
New php-forum User
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada
Contact:

### Users Online

Postby Xerpher » Thu Sep 05, 2002 1:36 pm

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"?

Jay

Postby Jay » Thu Sep 05, 2002 2:16 pm

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!

Xerpher
New php-forum User
New php-forum User
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada
Contact:

Postby Xerpher » Thu Sep 05, 2002 4:30 pm

Good Idea, I'll hook it in to my MySQL database... Whats your site Jay?

Jay

Postby Jay » Fri Sep 06, 2002 1:58 am

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!

Xerpher
New php-forum User
New php-forum User
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada
Contact:

Postby Xerpher » Fri Sep 06, 2002 3:32 am

Nice site, I like the "Info - Text Files" link :D

Jay

Postby Jay » Sat Sep 07, 2002 1:39 am

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!


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 2 guests