Re: executing a script on browser exit?
| From: | Jesper Juhl | Date: | Thu, 31 Aug 2000 20:10:47 +0000 |
| Subject: | Re: executing a script on browser exit? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-14674@lists.php.net to get a copy of this message | ||
Since HTTP is a stateless protocol there is no way to do what you want
(detect user leaving site or browser shutdown) on the server-side. You'll
have to use client-side scripting (like JavaScript) for that sort of
thing.
Regards,
Jesper Juhl
juhl@eisenstein.dk
>>>>>>>>>>>>>>>>>> Oprindelig meddelelse
>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<
Den 8/31/00, 9:55:06 PM, skrev csimons@cdwebstudios.com (Craig Simons)
til emnet [PHP] executing a script on browser exit?:
> Hello all! I've only recently picked up PHP, but I'm starting to gett the
> hang of it. My question is this: is there any way to execute a script
when
> the user leaves the site or closes the window? My current design sets a
> cookie that tracks the number of pages per session that a user views.
When
> the user exits the site, I would like to write that number to a file. I'm
> sure I could do the same thing by reading/writing to file every page, but
> that seems like quite the waste of system resources. Does anyone have any
> ideas or design alternatives?
> - Craig Simons
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net