Page 1 of 1

Cannot Modify Header

Posted: Thu Dec 31, 2009 10:11 pm
by brmcdani
I am getting the following error message:

Cannot modify header information - headers already sent by (output started at /home/content/s/a/g/sagates/html/contact.php:1) in /home/content/s/a/g/sagates/html/contact.php on line 17


Here is my code:

Code: Select all

<?php
ob_start();
$name = $_REQUEST['name'];
$phone = $_REQUEST['phone'];
$email = $_REQUEST['email'];
$pref = $_REQUEST['pref'];
$type = $_REQUEST['type'];
$kind = $_REQUEST['kind'];
$message = $_REQUEST['message'];
$body = "Name: $name
\nPhone Number: $phone
\nEmail: $email
\nContact Preference: $pref
\nJob Type: $type
\nInterested In: $kind
\nDescription: $message \n\n";
mail( "brett.mcdaniel@ttu.edu", "Contact Request", $body);header("Location: thankyou.htm");
?>
Can someone please help me out??? Thanks

Re: Cannot Modify Header

Posted: Thu Dec 31, 2009 11:00 pm
by requinix
Make sure there's nothing before the opening <?php and that you're saving your files as ASCII/ANSI and not UTF-8 or -16.

Re: Cannot Modify Header

Posted: Fri Jan 01, 2010 12:37 am
by daedalus__
why are you using output buffering?