Im writing a simple mailform for a homepage and when it runs it and the mail is sent I wan't to changer the header to another page, that writes that the letter has been sent.
The problem is that when I try to change the Header it comes with the following error :
Warning: Cannot add header information - headers already sent by (output started at /home/ in /home/ on line 40
I havn't change the header yet!!??
What's going on
My code looks (simplified) like this :
/* This is my line 1.*/
/* some kode here (Simplified) */
/* This is where it won't do it. My line 40*/
Why won't it change it?
Machine code Rocks
The problem is that when I try to change the Header it comes with the following error :
Warning: Cannot add header information - headers already sent by (output started at /home/ in /home/ on line 40
I havn't change the header yet!!??
What's going on
My code looks (simplified) like this :
Code:
<?php
Code:
require "menu.php";
$content = "";
$error = "";
if ($ditnavn){
$mailrecepient = "$modtnavn <$modtmail>";
$mailsubject = "Tilmelding til \"$forkortelse\"";
$mailbody = " $ditnavn har tilmeldt sig $betegnelse
$mailfrom = "From: $ditnavn <$dinemail>\r\nReply-To: $dinemail\r\nReturn-Path: $dinemail";
Code:
mail($mailrecepient, $mailsubject, $mailbody, $mailfrom);
Code:
header("Location: [URL unfurl="true"]http://www2.spejdernet.dk/udd/emailsendt.php?modtnavn=$modtnavn");[/URL]
exit;
}
?>
Why won't it change it?
Machine code Rocks