note 52661 added to function.header
| From: | darkstar_ae at hotmail dot com | Date: | Mon, 09 May 2005 02:02:26 +0000 |
| Subject: | note 52661 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89137@lists.php.net to get a copy of this message | ||
To spare some of you the mental anguish ang torture, be wary of line feeds & blank spaces in
your script before calling the header() function.
example:
start of file ----
<?
header('file.php');
?>
<html>
.
.
.
html codes follow
This may look like an innocent and correct script but the space between the imaginary start of file
marker and the "<?" will be read as a sent header to the browser. You may end up
spending hours trying to to debug the script and might even end up looking through the server
configs figuring this out. This problem is not so obvious.
This solution is only applicable to php configurations that don't use output buffering.
Happy hunting. ;)
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52661
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52661&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52661&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52661&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52661&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52661&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52661&report=yes
Search -- http://master.php.net/manage/user-notes.php