Jump to content

Checking to see if a user is connected every 5 minutes


Recommended Posts

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 :)
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
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.

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.