Re: detecting browser close or change of url

From: Date: Wed, 02 Jul 2003 15:00:40 +0000
Subject: Re: detecting browser close or change of url
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-29030@lists.php.net to get a copy of this message
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.


« previous php.db (#29030) next »