note 8644 deleted from setcookie by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Sat, 23 Sep 2000 12:03:22 +0000 |
| Subject: | note 8644 deleted from setcookie by jmcastagnetto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-5337@lists.php.net to get a copy of this message | ||
This is a really stupid bug in php 4.??/Redhat 6.2/IE/Netscape etc...
If you try to set a cookie is a function that is defined in an include file, you are very likely to
get an error saying "headers already sent". This is a bug because you get this error even
if you haven't printed anything yet. Ironically the problem is that it reads extra white space
after the ?> at the end of the include file as stuff to print out!!! Therefore to fix the problem
replace the closing ?>
with: return;?>
This ensures that no whitespace will be printed!