Re: [PHP-DB] detecting browser close or change of url
On 07/02/2003 10:06 AM, Jamie Saunders ([EMAIL PROTECTED]) wrote: > What I want to do is disable people logging into the same user account at the > same time. If this is your goal, try reversing your way of thinking. Instead of worrying about what happens when a user logs out (or doesn't), concentrate on what happens when the user logs in. For example you could remove previous sessions for a particular user upon successful login. To remove abandoned sessions, use a separate cron-controlled script in conjunction with PHP's built-in session garbage collector. Pablo -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] detecting browser close or change of url
You might also want to take a look at PEAR Auth http://pear.php.net/manual/en/package.authentication.auth.intro.php --rylin Hutchins, Richard wrote: Jamie, Read through this thread: http://marc.theaimsgroup.com/?l=php-db&m=104162246227155&w=2 Since you are using a login/logout system, you may be able to use some of the suggestions in here to solve your problem. Rich -Original Message- From: Oscar Rylin [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 02, 2003 11:01 AM To: Jamie Saunders Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] detecting browser close or change of url PHP is server-side, not client side. That said, what you could do is simply make use of window.onunload or window.onclose in javascript to bring up a second window/page.. of course, anyone with half a brain and a popup-stopper won't get that page :) --rylin Jamie Saunders wrote: Hi, I'm trying to figure out a way of detecting when a user closes the browser, or if they leave the site. If they do this I'd like to change a value in the database, i.e: if (browser is closed by user or they leave site) { // run php code to update database } Any help much appreciated. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] detecting browser close or change of url
Jamie, Read through this thread: http://marc.theaimsgroup.com/?l=php-db&m=104162246227155&w=2 Since you are using a login/logout system, you may be able to use some of the suggestions in here to solve your problem. Rich > -Original Message- > From: Oscar Rylin [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 02, 2003 11:01 AM > To: Jamie Saunders > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] detecting browser close or change of url > > > PHP is server-side, not client side. > That said, what you could do is simply make use of window.onunload or > window.onclose in javascript to bring up a second window/page.. > of course, anyone with half a brain and a popup-stopper won't > get that > page :) > > --rylin > > > Jamie Saunders wrote: > > >Hi, > > > >I'm trying to figure out a way of detecting when a user > closes the browser, > >or if they leave the site. If they do this I'd like to > change a value in > >the database, i.e: > > > >if (browser is closed by user or they leave site) > >{ > > // run php code to update database > >} > > > >Any help much appreciated. > > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] detecting browser close or change of url
Ok, let's explain the situation more fully: Basically I have a session controlled login system for users to my site. If they manually log-out, close the browser or move away from the site the variables that are needed for them to view the 'members area' are unset, hence they are logged out. What I want to do is disable people logging into the same user account at the same time. Therefore when they log in I set a value in the database to say the user account is locked. If they manually log out then this value is again changed to unlock the account. However, if they close the browser or leave the site I can't figure out a way to change the value in the database to unlock the account. Any suggestions? > PHP is server-side, not client side. > That said, what you could do is simply make use of window.onunload or > window.onclose in javascript to bring up a second window/page.. > of course, anyone with half a brain and a popup-stopper won't get that > page :) > > --rylin > > > Jamie Saunders wrote: > >>Hi, >> >>I'm trying to figure out a way of detecting when a user closes the >>browser, or if they leave the site. If they do this I'd like to change >>a value in the database, i.e: >> >>if (browser is closed by user or they leave site) >>{ >> // run php code to update database >>} >> >>Any help much appreciated. >> >> -- Jamie Saunders Media Architect [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] detecting browser close or change of url
PHP is server-side, not client side. That said, what you could do is simply make use of window.onunload or window.onclose in javascript to bring up a second window/page.. of course, anyone with half a brain and a popup-stopper won't get that page :) --rylin Jamie Saunders wrote: Hi, I'm trying to figure out a way of detecting when a user closes the browser, or if they leave the site. If they do this I'd like to change a value in the database, i.e: if (browser is closed by user or they leave site) { // run php code to update database } Any help much appreciated. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] detecting browser close or change of url
Hi, I'm trying to figure out a way of detecting when a user closes the browser, or if they leave the site. If they do this I'd like to change a value in the database, i.e: if (browser is closed by user or they leave site) { // run php code to update database } Any help much appreciated. -- Jamie Saunders Media Architect [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php