Re: !!Urgent .. Session Problem Solved ... But not completely
| From: | Dennis Gearon | Date: | Sun, 05 Sep 2004 00:43:42 +0000 |
| Subject: | Re: !!Urgent .. Session Problem Solved ... But not completely | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-195888@lists.php.net to get a copy of this message | ||
It has to be in SOME file. Probably in your prepend file or one of the files that it includes.
"Dre" <dre00x@yahoo.com> wrote:
<quote ----------------------------------------------------------------->
believe me the FIRST line in the file is <?php session_start();
NOTHING AT ALL exists before it.
but I still have the same error
"M. Sokolewicz" <tularis@php.net> wrote in message
news:20040904122330.97653.qmail@pb1.pair.com...
</quote ------------------------------------------------------------------>I think you didn't read all instructions we gave. One of them was to remove all spaces and/or newlines BEFORE the first <?php tag in your file, to save it and try again. anything before the <?php tag is considered HTML and thus output. Since headers are always sent before the output is, they will be sent the moment PHP notices the spaces and/or newlines. So, what happens is: PHP starts processing PHP encounters spaces and/or newlines PHP sends headers to the browser PHP sends those spaces and/or newlines to the browser PHP notices the <?php tag, and such swithed to "parsing-mode" PHP notices session_start(); and thus tries to send a cookie (a cookie is actually one of the headers) PHP notices that headers have already been sent! So it gives an error, because it can't "get them back and send them after the cookie again". <snip lots>