English 中文(简体)
使用隐藏字段防止垃圾邮件通过表格提交
原标题:Preventing spam submission via form using a hidden field

我的上司讨厌卡普查(Cabtcha),即使它们有效,我也不喜欢。她建议使用一个隐藏的字段,这样,如果[机器人]填写了表格,表格就不应该提交。这个方法是否有缺点?

最佳回答

您描述的方法通常被称为 < a href=> http:// en.wikipedia.org/ wiki/ Honeypot28computing% 29" rel="nofollow" >honeypot 。 虽然有些网站在过去取得了成功, 但一些网站的收效会因对网站进行垃圾处理的价值而不同。 此外, 蜂窝被广泛采用后, 正在使用能够绕过这些陷阱的智能软件块。 我建议您看看这个 < a href=> https://www. spacapetcher.com/captcha/faq.jsp# what_is_subirt_of_work" rel=“nofolpolt_of-f-workseration service

问题回答

您可以通过交换提交按钮和取消按钮的功能来欺骗任何机器人:

$( form ).submit(function(e){
    e.preventDefault();
    // remove user values
});
$( button ).click(function(e){
    e.preventDefault();
    var data = $( form ).serializeArray();
    data[ human ] = true; // hidden value
    $.post( example.com , data);
});




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签