Link to home
Start Free TrialLog in
Avatar of derrida
derrida

asked on

header problem

Hi
i have a contact form. when i send it i get:
Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\or_02\contact.php:290) in C:\wamp\www\or_02\contact.php on line 376

this is the most basic things.
the code is attached.

best regards

ron
if(isset($_POST['submit'])){
$to = "me@gmail.com";
$subject = $_POST["email_subject"];
$message = $_POST["email_msg"];
$from = $_POST["email_email"];
$headers = "From: $from";
$domail = mail($to,$subject,$message,$headers);
 
if($domail){
	header('Location: contacthanks.php');
}else{
	echo "not ok";
}
 
}

Open in new window

Avatar of Cornelia Yoder
Cornelia Yoder
Flag of United States of America image

This error usually means that you have a blank line at the beginning of your script.  If so, remove it.
Avatar of Kin Fat SZE
derrida,

what's the file type? plain text/UTF8 ?
if UTF8, it's mostly because of the byte order mark cause.
https://www.experts-exchange.com/questions/24037516/error-retrieve-session-data-from-UTF8-file.html
please read id 23333523
ASKER CERTIFIED SOLUTION
Avatar of Hube02
Hube02
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of derrida
derrida

ASKER

thanks