I have a form that I process with a php script that was given to me by one of the posters on this forum.
But when I process the form, I do receive an email with the appropriate information but my page redirection gives me the following error:
Warning: Cannot modify header information - headers already sent by (output started at /usr/home/web/users/a0017855/html/SIMC3c/HTML/process.php:2) in /usr/home/web/users/a0017855/html/SIMC3c/HTML/process.php on line 74
My process.php page is as follows:
<?PHP
##################################################
#####
# This script is Copyright 2003, Infinity Web Design #
# Written by Ryan Brill - [email]ryan@infinitypages.com[/email] #
# All Rights Reserved - Do not remove this notice #
##################################################
#####
## The lines below need to be edited...
###################### Set up the following variables ######################
# #
$to = "sean@caillouette.com"; #set address to send form to
$subject = "Results from your Request Info form"; #set the subject line
$headers = "From: Form Mailer"; #set the from address
$forward = 1; # redirect? 1 : yes
$location = "thankyou.htm"; #set page to redirect to, if 1 is above
# #
##################### No need to edit below this line ######################
## set up the time ##
$date = date ("l, F jS, Y");
$time = date ("h:i A");
## mail the message ##
$msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n";
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo ("Thank you for submitting our form. We will get back to you as soon as possible.");
}
?>
I asssume I need to change something with the header info. But what? and how?
thanks