RE: [PHP] Header() function and redirect
| From: | Don Read | Date: | Thu, 30 Aug 2001 20:39:12 +0000 |
| Subject: | RE: [PHP] Header() function and redirect | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-65368@lists.php.net to get a copy of this message | ||
On 30-Aug-2001 Zhu George-CZZ010 wrote:
> But I have to wait for the application to finish. The idea is: the
> application will take the file, and convert it into PDF file (it takes more
> than 30 seconds generally), then display the generated PDF file.
>
> I am just wondering if I can use "Header()" to redirect to a general php
> page, then in that page, redirect to the PDF file.
>
30 seconds might be timing-out,
instead let the browser handle the sleeping:
<?php
$goto='http://tt.mot.com/to_pdf/pdf_tmp/test.pdf';
$sleepfor=30;
printf('<META HTTP-EQUIV="Refresh" CONTENT="%d URL=%s">',
$sleepfor, $goto);
// run the job
$cmd='foo -bar baz ';
system($cmd);
?>
--
Don Read dread@texas.net
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.