|
Posted by Daedalus.OS on 10/14/47 11:17
> Dae,
>
> Without a request from the client for another 'page' won't I receive
> the 'Headers already sent' error?
>
> Eric
No. The thing here is that since you're calling it as a new page with a
<META HTTP-EQUIV="refresh"...>, the browser is actually waiting to receive a
totally new page with new headers. All what the page you call have to do is
making the file, send the proper header and the file. Since you're making it
as a Content-Disposition: attachment, the new page will not replace the
actual page in the browser but prompt to save it to disk instead.
So here is a simple view of what is happenning when a user click the link to
some_page.php:
-The browser receive the header for that page and display the page.
-Then the meta http-equiv="refresh"... attempt to refresh to file_gen.php
-The browser think he is going to another page and wait to receive the
headers
-file_gen.php create the file and then sends the headers + the file
-Browser receives the headers and see the Content-Disposition: attachment,
this mean (for the browser) do not display, prompt for download.
(This is a simplified view ... of course)
Dae
Navigation:
[Reply to this message]
|