Checking When A User Exits The Site And Update Mysql Table Upon Exit (SOLVED)
Posted 22 September 2006 - 01:39 AM
I have a community script that when a user is logged in it displays it on their profile, right now the only way for it to show them offline is to click the logout link. I want to be able to update the table and set online=0 when a user exits the website.
Any and all help is appreciated
Posted 22 September 2006 - 02:01 AM
so when a user logs out (if using a form)
update thier profile saying their offline
and when they login update profile to say hes online .
also if your using cookies it would be best to make the table default offline say they havent registered yet know what i mean?
Posted 22 September 2006 - 02:43 AM
Posted 22 September 2006 - 04:10 AM
You can either have it run as a regular job (like a cron script), or have it run each time a page is loaded. A common strategy is to have it run at random, say every 1 in 10 page loads. The right frequency depends on how often your pages get hit.
Unfortunately there is no way to detect them closing the browser.
Posted 22 September 2006 - 04:38 AM
Posted 22 September 2006 - 06:52 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users