Page 1 of 1
About the online user currently to be display?
Posted: Mon Sep 06, 2010 6:43 am
by coolesting
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 .
Re: About the online user currently to be display?
Posted: Mon Sep 06, 2010 8:35 pm
by yacahuma
sorry, dont understand the question
Re: About the online user currently to be display?
Posted: Tue Sep 07, 2010 9:57 pm
by coolesting
yacahuma wrote:sorry, dont understand the question
In other words, the website will be display all of users who is online when you access the website.
Re: About the online user currently to be display?
Posted: Tue Sep 07, 2010 10:06 pm
by Jonah Bron
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.