You are here: Re: Warning:Cannot modify header information... « PHP Programming Language « IT news, forums, messages
Re: Warning:Cannot modify header information...

Posted by Joe on 09/04/07 20:12

<mcserret@yahoo.com> wrote in message
news:1188935069.269968.221990@w3g2000hsg.googlegroups.com...
>I know this is a recurring problem that has been addressed here
> before, but even after reading all that has gone before, I am still
> stumped.
>
> I have a form that is designed to send data to a PHP page where is is
> to be validated then read into a MySQL table. Once that is done, the
> form is to send the user either back to the originating page, or to a
> logout page.
>
> I have several versions of this setup on my site that work well, so
> why should it not work on one page?
>
> I have checked for blanks and extra characters before and after <?php
> and ?> tags. there are none.
>
> 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 have stripped the code (a combination of php and javascript) in the
> orginating file of all extraneous stuff. Still not getting anywhere.
> I tried adding ob_start() and ob_end_flush() , still no joy.
>
> If I leave out the "header()" and "exit()" lines, the page processes
> and stores the information correctly and without any reported errors.
>
> I think that covers all the advise I've seen here, so my question is:
> Does anyone know what else can cause this problem?


Are you sure there is nothing at the top of the page (before your <?php
)

If so, try this on the very top line. (no blank lines or spaces)

<?php
if(headers_sent($file, $line)){
echo "Headers already sent in $file on line $line";
}
?>

 

Navigation:

[Reply to this 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

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