note 10639 added to setcookie
| From: | sysgod at ixir dot com | Date: | Sun, 14 Jan 2001 23:38:19 +0000 |
| Subject: | note 10639 added to setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-9791@lists.php.net to get a copy of this message | ||
Setting a cookie by using setcookie() also fails when you have split a PHP script. For example you
have two parts.
<?php
.....
?>
<?php
$CookieBlah="My trial cookie"
SetCookie("Trial",$CookieBlah);
?>
Whether you do print anything or not, send headers or not, or just call some includes for setup in
the first part the error you'll get is "Headers already sent. Output started on line
xxx"
If you join the two parts the script runs like a breeze.
Cheers,
Koray
http://www.php.net/manual/en/function.setcookie.php