note 51109 added to function.header
| From: | AakashShah at osu1 dot php dot net | Date: | Sun, 20 Mar 2005 05:52:39 +0000 |
| Subject: | note 51109 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86705@lists.php.net to get a copy of this message | ||
When using header(), beware that an HTML comment and a blank line can also prevent header() from
working and getting the message "headers cannot be modified...". Here is what I mean:
___START OF FILE1.php___
<?php
header('Location: file2.php');
?>
___END OF FILE1.php___
___START OF FILE2.php___
<!-- An HTML comment -->
<?php
header('Location: file2.php');
?>
___END OF FILE2.php___
So, if anyone is having problems with this, remember to remove any HTML comments.
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51109
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51109&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51109&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51109&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51109&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51109&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51109&report=yes
Search -- http://master.php.net/manage/user-notes.php