468,272 Members | 2,083 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,272 developers. It's quick & easy.

How many users currently viewing a page ?

I have come across this question many a times , i have a solution in my mind and i think it is effective enough to be used .

I need your opinion so that i can complete this idea and release the script under sourceforge.

"As soon as any page is opened , the IP Address and the current time is logged in the database. This will give us the idea that the user has opened the website.

Now when the user opens any other page of the same website , just "update" the TIME.
i.e. every page first checks if that IP is in the database , if yes update the time to current time otherwise make a new entry .

Suppose you want to display the users active over past 5 minutes , you can simply run a SQL query which checks all the users whose "time" of entry and the current time has a difference of less than 5 mins.

As mentioned in some other posts , if the user goes to make coffee or just keeps the page in background , the time in database wont be updated due to which the user will be treated as "INACTIVE" and hence will no longer count to the number of people actively visiting the page.

The Key is that , a user is active till the time he keeps on browsing webpages.

The same concept can be used even to display name of members active as in bulletin boards.

The time limit is flexible and can be adjusted as per requirements.

What do you think of my idea ? If you need help with it , i can make the script and release it.
Sep 3 '06 #1
0 1218

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by MyaTix | last post: by
14 posts views Thread by Brian Maupin | last post: by
9 posts views Thread by rdemyan via AccessMonster.com | last post: by
3 posts views Thread by ~john | last post: by
3 posts views Thread by wizardry | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.