简体   繁体   中英

Antibot spam protection on contact form

I`m using this in my contact form for antibot but still i received tons of mails:

<script type="text/javascript">
var a = Math.ceil(Math.random() * 10);
var b = Math.ceil(Math.random() * 10);      
var c = a + b 
function DrawBotBoot()
{
 document.write("Antibot "+ a + " + " + b +" = ");
 document.write("<input id='BotBootInput' type='text' maxlength='2' size='2'/>");
}    
function ValidBotBoot(){
    var d = document.getElementById('BotBootInput').value;
    if (d == c) return true;        
    return false;

}
</script>

Can someone help me and make this to ask for lets say "what is current year" or something like this ? Thank you

Use CAPTCHA to protect yourself from Bots. Something like reCaptcha will suite your needs. It will much decrease the amount of spam messages to your form.

对于那些因任何原因不想使用reCaptcha而且仍然存在基本数学问题的人来说,这可以是限制机器人数量的解决方案: http//www.lateralcode.com/basic-math-security/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM