Posted by Sanders Kaufman on 09/04/07 21:10
mcserret@yahoo.com wrote:
> I have POSTed to a page with _only_ the following code: (Again- there
> are no blanks or other characters either before or after.)
>
> <?php
> header("location:www.foo.org/subdir/enterStuff.php");
> ?>
>
> It still comes back with:
> "Warning: Cannot modify header information - headers already sent by
> (output started at /var/www/foo.org/html/subdir/postStuff.php:1) in /
> var/www/foo.org/html/Events/postStuff.php on line 2."
I'm not always sure *why*, but putting session_start() at the top has
always resolved that problem for me.
Apparently, if you don't, the web server tends to start sending headers
even before the page runs.
I'm not sure how that is possible - because it seems that the web server
would have to predict when a page uses session_start() or not.
But... it fixes the problem... for me.
Navigation:
[Reply to this message]
|