Forum Moderators: coopster
I'm very new to PHP, and have been desperately trying to make the submit button on my form redirect to a confirmation page. But the header() function keeps giving this kind of error message:
----------------
Warning: Cannot add header information - headers already sent by (output started at /customers/mydomain/mydomain/httpd.www/mysubdomain/header.php:1) in /customers/mydomain/mydomain/httpd.www/mysubdomain/mail2.php on line 5
---------------
My code looks like this in the header of mail2.php:
-----------
<?php
if ($_REQUEST["Submit"]) {
header("Location:confirmation.php");
$Email = $_REQUEST['Email'] ;
mail("me@me.com", "Newsletter", "From:$Email");
}
else {
}
?>
-------------
I really hope that someone can help me out, as I'm about to go crazy with this.... ;-)
Thanks in advance!
Sofia
I actually realised later that my include wasn't working that well, since my original page was now just further down the page...
Anyhow, I gave it a last shot with the header(), and it now works! HURRAY!
Yep! There mustn't be anything before allright... I just never imagined that that included the DTD as well...
I'm a lot smarter now :)