Jump to content

Archived

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

predator12341

Checking to see if a user is connected every 5 minutes

Recommended Posts

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 something

thanks regards Mark

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

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.