Hi,
Im new to PHP and contact forms so need some help getting my data collection form to work.
Im hosting on Fasthost. My form action is '/htdocs/form/sendmail.php'.
my script is:
<?php
$email_to="form@iter-research.co.uk";
$name=$_POST["Name"];
$email_from=$_POST["form@iter-research.co.uk"];
$message=$_POST["Name,Address,Postcode,Email,Gender,Age,Correspondence"];
$email_subject="Consultation Form";
$headers=
"from:$email_from.\n";
"reply-to:$email_from.\n";
if(!filter_var($email_from, FILTER_VALIDATE_EMAIL)) {
die("The email address entered is invalid.");
$message = "Name: ". $name . "\r\nMessage: " . $message;
ini_set("sendmail_from", $email_from);
$sent = mail($email_to, $email_subject, $message, $headers, -f$email_from);
if($sent) {
header("Location: http://www.iter-rese...hank_you.html/");
} else {
echo "There has been an error sending your message. Please try later.";
}
}
?>
When i hit the submit button the browser just trys to open a new window with my PHP script in.
I'm New to PHP and contact forms so if im doing something really basic and stupid i apologise in advance.
has anyone got any suggestion??
Simon