我想通过使用此处描述的网络表单混淆方法来捕获垃圾邮件发送者。
唯一的问题是我在ColdFusion服务器上,而且我的mailto
表单是 cfm 格式的。
if( !isset($_POST['name'])) { die("No Direct Access"); } // Make sure the form has actually been submitted
$name = $_POST['name'];
$email = $_POST['email'];
$spam = $_POST['username']; // This is our Honeypot field
if($spam) { // If the Honeypot field has been filled in
die("No spamming allowed!");
} else {
// Process the form like normal
}
(更新:评论中的代码)
我的表格:
<tr style="display: none;">
<td> <li id="user" style="display: none;">
<label for="spamCatch">spamCatch</label>
<input type="text" name="spamCatch">
</li>
</td>
</tr>
我的邮件cfm:
<cfparam name="form.Notform1" default="">
<cfset spam = false>
<cfif structKeyExists(form,'name')>
<cfset spamCheck = form.spamCheck>
<cfif spam>
No spam.
<cfabort>
<cfelse>
<cfmail from="title" to="email" subject="subject" server="servername" type="html">
<style type="text/css">
<cfinclude template="../css/cfForms.css">
</style>
HTML HERE FROM FORM
</cfmail>
</cfif>
</cfif>