predator12341 Posted May 3, 2006 Share Posted May 3, 2006 Hi i was just wondering if i have a frame that is always open can i make it check for example every 5 minutes if a user is still logged on and if it is it plays a sound or somethingthanks regards Mark Link to comment https://forums.phpfreaks.com/topic/8972-checking-to-see-if-a-user-is-connected-every-5-minutes/ Share on other sites More sharing options...
SharkBait Posted May 3, 2006 Share Posted May 3, 2006 If your database has an entry for activity that when ever a page is loaded the entry is updated with a timestamp.To check if users online you would query the database for activity that is less than 5mins from present time.If it doesnt make sense I can try and find my code that I use to show users that are actively online :) Link to comment https://forums.phpfreaks.com/topic/8972-checking-to-see-if-a-user-is-connected-every-5-minutes/#findComment-32972 Share on other sites More sharing options...
predator12341 Posted May 3, 2006 Author Share Posted May 3, 2006 na i understand so each time a page is changed the db is updated with the new time stamp but that is not very acuate as if they are a slow reader and reading a long post then it will not be a possitive thing that is the only trouble there as i thought of something like that Link to comment https://forums.phpfreaks.com/topic/8972-checking-to-see-if-a-user-is-connected-every-5-minutes/#findComment-32979 Share on other sites More sharing options...
.josh Posted May 3, 2006 Share Posted May 3, 2006 you have 2 options: make a seperate script that does the check and setup a cronjob to be executed every 5 minutes, but then this doesn't really solve your "slow reader" problem. other option is to look into client side scripting such as javascript, where content can be updated "live" on their side, as php is dependent on the user clicking the next linkie or whatever. Link to comment https://forums.phpfreaks.com/topic/8972-checking-to-see-if-a-user-is-connected-every-5-minutes/#findComment-32981 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.