我的官方网站上有一个博客。我允许人们在我的博客上发表评论,但我不想从自动机器人那里得到评论。因此,我想在评论表单中添加一个称为“安全问题”的额外字段。但我不知道该怎么做。
这是我处理现有联系人表单的代码。(contact\\u info\\u 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:www.jtdesign.my/enquiry-form/有什么解决方案可以将此代码应用于wordpress评论表单?我只想添加“安全”字段。