executing a script on browser exit?

From: Date: Thu, 31 Aug 2000 19:58:51 +0000
Subject: executing a script on browser exit?
Groups: php.general 
Request: Send a blank email to php-general+get-14672@lists.php.net to get a copy of this message
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

« previous php.general (#14672) next »