Jump to content

Whose Online?


Rustywolf

Recommended Posts

Im trying to make a shoutbox/forum

And i want to code a command /whosonline

im wondering, how do i find this?

 

If their online is easy to detect, just set on session create.

How would i detect them closing the page? (instead of just logging out)

 

Theirs a javascript command which does something like that, but im drawing blanks

anyone have any ideas?

 

(either on browser/window close or when the session runs out)

Link to comment
https://forums.phpfreaks.com/topic/196216-whose-online/
Share on other sites

Well you could use a database table to store their last online date and time, then every time a webpage is loaded, check if that user is authorised, if they are then update the time they were last on to the current time. At the same time it checks whether they're registered it should also check whether the other people in the list have a time last online older than say, 5 minutes ago, and should remove those people, thus Only those around in the last 5 minutes will be in the table, and you can extract their usernames for your list of people online.

Link to comment
https://forums.phpfreaks.com/topic/196216-whose-online/#findComment-1030523
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.