Jump to content

Detect stop page load button


F1Fan

Recommended Posts

Is there a way to detect if someone hit the "Stop" button on their browser before the page finishes loading?

 

I have a page that runs a CGI script. The CGI script then generates a PHP file that is then included in the first page. When it is done using the CGI-generated PHP file, it deletes it. This all works perfectly, except that if the user hits the stop button, the CGI still finishes generating the PHP file, but that file is never deleted.

 

Also, each time this file is generated, it uses a unique name to prevent two users from trying to access the same file (one could delete the file while the other is still using it). So there's no way to delete all the files when loaded.

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/125961-detect-stop-page-load-button/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.