Hi,
how design the function about the online users currently to be display when you logon that website be presented ?
who can get me some idea in detail ,
thanks anybody suggestion, much appreciate .
About the online user currently to be display?
Moderator: General Moderators
- coolesting
- Forum Newbie
- Posts: 13
- Joined: Thu Sep 02, 2010 12:36 am
Re: About the online user currently to be display?
sorry, dont understand the question
- coolesting
- Forum Newbie
- Posts: 13
- Joined: Thu Sep 02, 2010 12:36 am
Re: About the online user currently to be display?
In other words, the website will be display all of users who is online when you access the website.yacahuma wrote:sorry, dont understand the question
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: About the online user currently to be display?
You'll need to put a last_visit column into your users table if you don't already have one. Whenever a logged-in user visits a page, it updates the last_visit column with time() [http://php.net/time].
Then, when you want to list online users, just check the users table for users who's last_visit is within a threshold for age. For example, time() - (60*10) would only show users that had been seen within ten minutes ago.
Then, when you want to list online users, just check the users table for users who's last_visit is within a threshold for age. For example, time() - (60*10) would only show users that had been seen within ten minutes ago.