IrishDoc
10-15-2012, 11:56 AM
Can someone please help with what I need to add to get the captcha to validate when the form is submitted.
<?php
$to = "@gmail.com,@brilliantbulb.com";
$from = $_POST["email"];
$subject = "Quote Request";
$name = $_POST['name'];
$phone = $_POST['phone'];
$project_description = $_POST['project_description'];
$project_timeline = $_POST['project_timeline'];
$email = $_POST["email"];
// validation
$validationOK=true;
if (Trim($email)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=/?page_id=258\">";
exit;
}
$body = "Please contact the following person to discuss their project outlined below.\n\nFrom: $name\nEmail: $email\nPhone: $phone\n\nProject Description:\n$project_description\n\nThe following is information concerning the timeline.\n$project_timeline
";
$success = mail($to,$subject,$body,"From: <$email>");
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=/thank-you/\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=/?page_id=258\">";
}
?>
The captcha is located at this page http://swatbeta.brilliantbulb.com/contact/request-info/ as you can see the captcha is posting correctly and refreshing as needed but it allows the form to be sent without validating the captcha text entered.
<?php
$to = "@gmail.com,@brilliantbulb.com";
$from = $_POST["email"];
$subject = "Quote Request";
$name = $_POST['name'];
$phone = $_POST['phone'];
$project_description = $_POST['project_description'];
$project_timeline = $_POST['project_timeline'];
$email = $_POST["email"];
// validation
$validationOK=true;
if (Trim($email)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=/?page_id=258\">";
exit;
}
$body = "Please contact the following person to discuss their project outlined below.\n\nFrom: $name\nEmail: $email\nPhone: $phone\n\nProject Description:\n$project_description\n\nThe following is information concerning the timeline.\n$project_timeline
";
$success = mail($to,$subject,$body,"From: <$email>");
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=/thank-you/\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=/?page_id=258\">";
}
?>
The captcha is located at this page http://swatbeta.brilliantbulb.com/contact/request-info/ as you can see the captcha is posting correctly and refreshing as needed but it allows the form to be sent without validating the captcha text entered.