I am having a problem with a contact form that I am creating, I have tried to look up about the same error, I dont seem to have any white spaces and I have read that you should not have an echo before the header tag but as you can see, I need it that way and I have had it working in this order before on another site. The error is:
Warning: Cannot modify header information - headers already sent by (output started at /home/vicarage/public_html/mail.php:8) in /home/vicarage/public_html/mail.php on line 25
Here is the coding for the php file:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Submitting...</title>
</head>
<body>
<?php
$Name = $_POST ['full_name'];
$Email = $_POST['email'];
$Number = $_POST['phone_number'];
$Company = $_POST['company_name'];
$Message = $_POST['message'];
$formcontent="Name: $Name
\n Email: $Email
\n Number: $Number
\n Company: $Company
\n Message: $Message";
$recipient = "info@vicarage-support.com";
$subject = "Contact";
$mailheader = "From: $Email \r\n";
ini_set("sendmail_from","info@vicarage-support.com");
mail($recipient, $subject, $formcontent, $mailheader) or die("Please try again.");
echo("Form Submitted.");
header("Location:http://www.vicarage-support.com/contact_us.html");
?>
</body>
</html>
Thanks in advance guys.