Stats of viewers

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
xionhack
Forum Contributor
Posts: 100
Joined: Mon Nov 10, 2008 9:22 pm

Stats of viewers

Post by xionhack »

Hello. I have a website in php and people can login. I want to make an admin control panel where u can see how many people are currently logged in and also how many people in total (including the ones that are not logged in) are visiting the site in this moment. How can I do that? Thanks!
tang
Forum Newbie
Posts: 6
Joined: Sun Nov 15, 2009 9:14 pm

Re: Stats of viewers

Post by tang »

make a colum in user table of database.if the user is online.then the colum value is 0,if the user logout, turn it to 1.
if you want to kown how many pepole is visting. It's the same way!
xionhack
Forum Contributor
Posts: 100
Joined: Mon Nov 10, 2008 9:22 pm

Re: Stats of viewers

Post by xionhack »

How about if the person just closed the browser without login out, how would I know? Thanks!
jhack
Forum Newbie
Posts: 10
Joined: Wed Mar 11, 2009 9:46 pm

Re: Stats of viewers

Post by jhack »

@xionhack
I think then you should consider about session time up after particular time form his last action. The time depends on your need.
Post Reply