Got the form working - but it is too quick off the mark
Hi Ian
Thank you so much for your help. Here is the code I am using to try and get the form to work. I have got rid of the licence info and the form is going to my address - however when you click on the page, it appears briefly - then an error message shows Http 404 (again) - just sending a blank form.
Thanks for you assistance
Pam
</head>
<?php
$EmailFrom = "*****@******.com";
$EmailTo = "******@*******.com";
$Subject = "Online Form";
$Name = Trim(stripslashes($_POST['Name']));
$Tel = Trim(stripslashes($_POST['Email']));
$Email = Trim(stripslashes($_POST['Comments']));
// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Comments;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=thank-you.php\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=something-went-wrong.php\">";
}
?>
<body>