Re: Header page error
| From: | Jesper Juhl | Date: | Wed, 06 Sep 2000 19:38:14 +0000 |
| Subject: | Re: Header page error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15582@lists.php.net to get a copy of this message | ||
Wee Chua wrote:
>
> Hi all,
> Why I couldn't jump to another page in my codes if login process fail? Here
> are my codes:
>
<...snip...>
>
> And it also gave me this error message "Warning: Cannot add header
> information - headers already sent by (output started at
> /usr/local/apache/htdocs/SSL/main.php:2)" when I tried to login. Why??
>
> Thank you very much.
> Calvin
You can only send header information before you output any actual
content. So the Warning you are recieving is becourse you attempt to
send a Location header after output has been send to the browser. A neat
way around this is to enable output buffering, either globaly in php.ini
or on a page by page basis by using the ob_* functions or ofcourse not
output data before all headers have been send.
Hope this helps,
Jesper Juhl
juhl@eisenstein.dk