forcing a script to run on page unload

From: Date: Wed, 19 Jul 2006 04:32:27 +0000
Subject: forcing a script to run on page unload
Groups: php.general 
Request: Send a blank email to php-general+get-239565@lists.php.net to get a copy of this message
Hi: I have a web application that creates files and directories to save info for a user. If the user decides to link to another page or site altogether I want to run a script that will clean up after him or her but won't interfere with where they are going. It will eventually expand to asking the user if he or she wants to save the info for a return visit. If they don't want to save it has to clean up after them and if they do it goes through the process of tagging and saving the info on the server. My strategy is to run a spontaneous form submission with the body onunload event. Then run the script and exit. I seem to remember a way to force a script to run and I've seen that in a site that I visit occasionally. Even if I quit the browser it still manages to delay the exit of the browser. But I don't remember whether it was one of my books on php or the php manual that this is in. Can someone point me in the right direction? Thanks in advance: JK

« previous php.general (#239565) next »