RE: [PHP] send header and close connection, but still run additional code
| From: | John W. Holmes | Date: | Wed, 23 Apr 2003 01:40:26 +0000 |
| Subject: | RE: [PHP] send header and close connection, but still run additional code | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144935@lists.php.net to get a copy of this message | ||
> I am working on a redirect script that sends the client a "Location"
> header via the header() function. This script needs to stay alive and
do
> additional work after the header is sent (database work, log
crunching,
> etc).
>
> Basically, the code looks like:
>
> <?php
>
> header("Location: http://remote.site/url");
>
> ## Do my intensive work here...
Maybe you could use a shutdown function to do all of extra work?
http://www.php.net/manual/en/function.register-shutdown-function.php
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/