|
Posted by Randy Webb on 10/07/13 11:33
Thomas 'PointedEars' Lahn said the following on 11/30/2005 2:56 PM:
> Randy Webb wrote:
>
>
>>Thomas 'PointedEars' Lahn said the following on 11/29/2005 9:54 AM:
>>
>>>[in PHP, header() only works if there was no previous output.]
>>
>>Not entirely true.
>
>
> ,-<URL:http://php.net/manual/en/function.header.php>
> |
> | Remember that header() must be called before any actual output is sent,
> | either by normal HTML tags, blank lines in a file, or from PHP. It is a
> | very common error to read code with include(), or require(), functions,
> | or another file access function, and have spaces or empty lines that are
> | output before header() is called. The same problem exists when using a
> | single PHP/HTML file.
>
> Maybe you are referring to this:
Yes.
> | <?php
> | header("HTTP/1.0 404 Not Found");
> | ?>
> |
> | Note: The HTTP status header line will always be the first sent to the
> | client, regardless of the actual header() call being the first or not.
> | [...]
>
> However, additional header() calls, including sending issueing HTTP status
> headers do not qualify as "(actual) output" here.
Depends on the definition of output. And whether you consider output as
text to the browser or if the headers are considered output.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Navigation:
[Reply to this message]
|