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 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
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
]
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
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
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),