RE: [PHP] setcookie statements are giving me error
| From: | Ryan Schefke | Date: | Wed, 14 Apr 2004 20:13:22 +0000 |
| Subject: | RE: [PHP] setcookie statements are giving me error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-183375@lists.php.net to get a copy of this message | ||
Curt,
Thanks. That was the issue. Am I allowed to redirect directly below the
setcookie functions using "header ('Location...."
Thanks,
Ryan
==================================================================
-----Original Message-----
From: Curt Zirzow [mailto:czirzow@dotgeek.org]
Sent: Wednesday, April 14, 2004 3:29 PM
To: php-general@lists.php.net
Subject: Re: [PHP] setcookie statements are giving me error
* 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."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php