EM> What is the best method for a Who's online type of thing?

EM> Users can either log in or be automatically logged in with a cookie on
EM> the site.

EM> How can I "see" when the user is "there" or "gone"

EM> Am I better of reading a text file or a database table?
EM> With a cron to update every x minutes the number/handles of the users?

the way i'd probably do it would be to update a database table every
time a user logged in. the table could have (username, last_access)

there is no real way with HTTP to see id a user is "there" or "gone",
the only way you can tell is if a user has not accessed any pages for
x minutes... say if they haven't accessed for 10 minutes they are
"gone".

so, on all of your pages have a function to update the "last access"
table, and when you want to see who is "there", do a select from the
table where last_access > 10 minutes ago

if you have only a few users then this will be okay, but if you have
lots of users then a cron job to delete records where the user
hasn't accessed for more than 10 minutes running once a day or
something would be good.

hope that gives you some idea of a way to start...


-- 
Best regards,
 Daniel


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to