• PHP Help PHP Newbies
  • Warning: Cannot modify header information - headers already sent by (output started a

I am getting an error.... Warning: Cannot modify header information - headers already sent by (output started at /home/content/b/r/a/brayden822/html/send_estimate.php:6)

What do I need to do.

<body>
<?
if (($POST[firstName] == "") || ($POST[lastName] == "") || ($POST[address] == "") || ($POST[city] == "") || ($POST[state] == "") || ($POST[zip] == "") || ($POST[phone] == "") || ($POST[cphone] == "") || ($POST[email] == "") || ($POST[contact] == "") || ($POST[time] == "") || ($POST[products] == "") || ($POST[priority] == "") || ($POST[within] == "") || ($POST[when] == "") || ($POST[source] == "")) {
header("Location: send_estimate.html");
exit;
}

This is on my send_estimate.php page...

does that make a difference...

It is basically my check point for errors... if they don't enter any data... they have to fill out the form again....

What am I doing wrong!!!

Jay

    Put your PHP code which decides whether or not to do the redirect before anything that would generate output, including HTML markup.

      It is a php file right so why do you have an html markup tag which produces output? If the above is the entirety of you code then remove the <body> tag. If there is more remove it as well, after all it is just a php file and needs no html markup.

        You might also try searching the board with a couple of keywords.. e.g. "cannot modify header information" or even "headers already sent".

          Sometimes if you are having trouble tracking this down, it is due to blank spaces outside of your php tags.

            Write a Reply...