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.
Thanks,
George
-----Original Message-----
From: * R&zE: [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 30, 2001 11:19 AM
To: Zhu George-CZZ010; [EMAIL PROTECTED]
Subject: Re: [PHP] Header() function and redirect
<Original message>
From: Zhu George-CZZ010 <[EMAIL PROTECTED]>
Date: Thu, Aug 30, 2001 at 11:10:19AM -0500
Message-ID: <[EMAIL PROTECTED]>
Subject: [PHP] Header() function and redirect
>
> I am using Apache and PHP. I encountered a redirect problem in PHP, and traced it
>down, so, I generated a very short PHP page as following:
>
> <?php
> sleep(30);
> $goto = "http://tt.mot.com/to_pdf/pdf_tmp/test.pdf";
> Header("Location: $goto");
> exit;
> ?>
>
> If the "sleep(30);" statement is commented out, this page works fine in both
>IE4.0/IE5.0 and netscape, but if "sleep(30)" statement is in this page, it will only
>work in Netscape, but not in IE.
>
> Is there another way to do the "redirect" in PHP? or how to fix this problem (I
>can't remove the "sleep" statement because in the real program, it is a "System call"
>and will take more than 30 seconds)?
>
> Thank you very much in advance.
>
> Regards,
> George
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
</Original message>
<Reply>
You can (possibly) just redirect before the rest of your script.
Ofcourse you can't do that when the rest of the script produces
output, but it seems to me like it doesn't.
Try the next code:
--- PHP code ---
<?php
header ("Location: http://somewhere.com");
error_log ("And still my script is running!", 0);
?>
--- End of PHP code ---
You'll see that the original script will write the line to the
logfile although the user is already redirected to the next page.
Btw... 30 seconds is a rather long time. No user will ever want to
wait that long. Just my opinion...
</Reply>
--
* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»»
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- ««««««««««««««««««««««««
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]