471,046 Members | 1,286 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,046 software developers and data experts.

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 1277

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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.