Rustywolf Posted March 23, 2010 Share Posted March 23, 2010 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 More sharing options...
dooper3 Posted March 23, 2010 Share Posted March 23, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.