Reply to Re: Warning:Cannot modify header information...

Your name:

Reply:


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.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация