RE: [PHP] Cookie Problem
| From: | John W. Holmes | Date: | Sat, 19 Apr 2003 00:27:06 +0000 |
| Subject: | RE: [PHP] Cookie Problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144450@lists.php.net to get a copy of this message | ||
> But when ever i attempt to either login or logout, the cookies wont
send
> giving me the following error
>
> <b>Warning</b>: Cannot modify header information - headers already
sent
> by (output started at e:\htdocs\sagestower\login.php:1) in
> <b>e:\htdocs\sagestower\corelayout\function.php</b> on line <b>44</b>
I didn't read your code as this is a very common error. Searching for
the key words of the error would have turned up plenty of suggestions in
the archives.
You must send all of the headers before you send any data. Cookies are
included in the headers. _Any_ output is going to cause the end of
setting the headers, that includes any HTML or even a space.
In function.php on line 44 you are sending some data. You are trying to
set a cookie or send a header at some point after that line. It's not
going to work.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/