Forum Moderators: coopster
Now, I am tring to send a user to a 'Thank you' page after they fill out an inquiry form. The form works fine, but throws an error trying to redirect. Any help is greatly apreciated.
ERROR
Warning: Cannot modify header information - headers already sent by (output started at /home/u5/widgets/html/form.php:6) in /home/u5/widgets/html/form.php on line 43
PHP CODE
<?
if($Action=="Request Consultation"){
if($_POST){
//checks for form post
$Recipient = "info@widget.com";
$Subject = "Consulting Request for $FirstName $LastName";
$Headers = "From: Widget World <info@widget.com>\r\n";
$Headers.= "Bcc: info@widget.com\r\n";
$Headers.= "Return-info@widget.com\r\n";
//helps with spam filters
//when building the message string the .= appends the string onto the current content of $Message
// \n is a new line character
$Message.= "Consulting Request courtesy of FWidget World\n";
$Message.= "\n";
$Message.= "First Name: $FirstName\n";
$Message.= "Last Name: $LastName\n";
$Message.= "Email: $Email\n";
$Message.= "Address: $Address\n";
$Message.= "City: $City\n";
$Message.= "State: $State\n";
$Message.= "Zip: $Zip\n";
$Message.= "Phone: $Phone\n";
$Message.= "\n";
mail($Recipient,$Subject,$Message,$Headers);
header("location: /thankyou.php");
//here is the redirect
}
}
?>
Thanks!
KOB