note 51109 deleted from function.header by sp
| From: | sp@php.net | Date: | Sun, 03 Jul 2005 13:51:40 +0000 |
| Subject: | note 51109 deleted from function.header by sp | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-91358@lists.php.net to get a copy of this message | ||
Note Submitter: Aakash Shah
----
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.