Re: setcookie statements are giving me error
| From: | Curt Zirzow | Date: | Wed, 14 Apr 2004 19:28:50 +0000 |
| Subject: | Re: setcookie statements are giving me error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-183368@lists.php.net to get a copy of this message | ||
* Thus wrote Ryan Schefke (ryanschefke@triomfgroup.com):
>
> cannot modify header errors, which tells me there's nothing wrong with my
> main script. Am I doing something wrong with cookies here?
>
> "Warning: Cannot modify header information - headers already sent by....."
You're missing the most important part of the message, like at
exactly what line the output started.
>
> setcookie ("acctActive_ck", "$daysRemaining"); //set cookie for active
> account, will terminate when browser window closes
> if (setcookie("acctActive_ck")) { echo "active cookie set"; } else { echo
> "active cookie not set";}
No other cookie can be set after this line. Headers are sent once
you echo something.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."