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 Quote Link to comment 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 :) Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.