I have a blog for my official website. I allow people for commenting on my blog but i don't want to get comment from auto-bot. Therefore, i am thinking of to add an extra field which is called "security question" to the comment form. But i don't know how to make it work.
This is the code i have for processing my existing contact form. (contact_info_submit.php)
<?php
$name = $_POST['name'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$location = $_POST['location'];
$purpose = $_POST['purpose'];
$status = $_POST['status'];
$findus = $_POST['findus'];
$inquiry = $_POST['inquiry'];
$security = $_POST['security'];
$from = "JT Design";
$to = "inquiry@jtdesign.my";
$subject = "$from, $name has submitted the enquiry form.";
$message = "Hi $from,\n$name has submitted the enquiry form. Details are as follow: \n\n/*** Form Details Begin ***/\n\nName: $name\nPhone Number: $phone\nEmail Address: $email\nLocation: $location\nContact Purpose: $purpose\nHouse Status: $status\nHow did visitor find us?: $findus\nMessage: $inquiry\n\n/*** Form Details Ended ***/\n\nPlease response to $name as soon as possible.\n\nRegards,\n$from";
if ($security=="17") {
mail($to, $subject, $message, "From: JTDesiGn");
header("Location:/thanks.php");
}
else {
header("Location:/enquiry-form/?Submission=failed");
}
?>
Url to see my online enquiry form: www.jtdesign.my/enquiry-form/
Any solution to apply this code to wordpress comment form? I want to add the "security" field only.