Re: Ignoring user cancel
| From: | Daniel Brown | Date: | Mon, 25 Feb 2008 18:01:27 +0000 |
| Subject: | Re: Ignoring user cancel | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-270088@lists.php.net to get a copy of this message | ||
On Fri, Feb 22, 2008 at 9:19 PM, K T Ligesh <ligesh@lxlabs.com> wrote:
>
> Hello,
>
> I have a php process running on lighty that should continue even if the user presses cancel
> in his browser. The default behavior is that the web-server will kill the cgi process on user
> cancellation. Is there some way I can prevent the user cancel from interfering with the php process.
> Can I ignore the web-server's kill in php or is this a configuration that should be handled at
> the web-server?
Check out these two functions:
ignore_user_abort():
http://php.net/manual/en/function.connection-aborted.php
connection_aborted():
http://php.net/manual/en/function.connection-aborted.php
The latter of which can help with logging if you want to see when
the user killed the connection.
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>