如何防止机器人自动提交表单?

发布于 2024-09-08 19:32:51 字数 223 浏览 7 评论 0原文

我正在运行 ColdFusion MX,因此无法使用内置的 在提交表单之前,我的应用程序中的 cfimage Captcha 功能

但问题是,如果没有验证码,机器人就会提交表单。

防止自动提交的最佳方法是什么?

I am running ColdFusion MX, so I don't have the possibility of using the built-in cfimage Captcha functionality in my application, before form submitting.

But the problem is without captcha the bots submit the forms.

What will be best way to prevent automatic submitting?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

九八野马 2024-09-15 19:32:51

验证码不一定是图像!

尝试以下解决方案之一:

  • 大多数机器人不理解 CSS。创建两个提交按钮,第一个具有将被服务器拒绝的值,第二个具有将被服务器接受的值。使用 CSS 隐藏第一个。
  • 要求用户回答一个简单的数学问题。这将要求您创建数学问题并将预期的解决方案存储在某处(例如用户的会话),然后将用户提交的答案与存储的答案进行比较。为了获得额外的保护,您可以创建简单的加法、减法和乘法问题。避免除法,余数对于某些用户来说是一种痛苦。
  • 机器人读取表单元素的名称,并倾向于忽略文本标签。尝试创建一个名为“optout”的复选框(如新闻通讯),默认情况下处于选中状态。在复选框旁边,要求用户取消选中该复选框(如果他们是人类)。相反的技术也适用(未选中您要求用户选中的复选框)。

所有这些解决方案都无需第三方代码或 API 调用即可完成。

话虽这么说,reCAPTCHA 非常好,并且很容易集成到几乎任何环境。

Captchas don't have to be images!

Try one of the following solutions:

  • Most bots don't understand CSS. Create two submit buttons, the first with a value that will be rejected by the server, the second with a value that will be accepted by the server. Hide the first one using CSS.
  • Ask the user to answer a simple math problem. This will require you to create the math problem and store the expected solution somewhere (like the user's session), then compare the user's submitted answer with the stored answer. For extra protection, you can create simple addition, subtraction and multiplication questions. Avoid division, remainders are a pain for some users.
  • Bots read the names of form elements, and tend to ignore text labels. Try creating a checkbox named "optout" (like a newsletter), checked by default. Next to the checkbox, ask the user to uncheck the checkbox if they are a human. The opposite technique also works (unchecked checkbox that you ask the user to check).

All of these solutions can be done without third party code or API calls.

That being said, reCAPTCHA is pretty good and easy to integrate into almost any environment.

記憶穿過時間隧道 2024-09-15 19:32:51

看一下 cfformprotect - 它适用于 CFMX 6 和所有更高版本的引擎。

它的目标是完全可访问 - 对大多数用户来说是不可见的 - 通过各种方法来阻止机器人和垃圾邮件发送者。

此外,您可能还想查看 reCaptcha 的 CF 包装器,它与 CFMX 7 兼容。

Take a look at cfformprotect - it will work with CFMX 6 and all later engines.

It aims to be fully accessible - and invisible to most users - with an assortment of methods to stop bots and spammers.

Also you might want to look at a CF wrapper for reCaptcha, which is compatible with CFMX 7.

单调的奢华 2024-09-15 19:32:51

我与另一种技术一起使用的技术是使用图像按钮。您的 POST 处理程序获取单击图像的 x,y 坐标。我发现机器人(只是生成帖子请求)正在传递 0,0,通过将这些请求放在地板上,我将垃圾邮件帖子减少到少于真实帖子。抱歉,我不知道如何在 CF 中做到这一点,但我希望该技术对您有用。

A technique I used with a different technology was to use image buttons. Your POST handler gets the x,y co-ordinates where the images were clicked. I found the bots (which are just generating post requests) were passing 0,0 and by dropping those requests on the floor I brought the spam posts down to less than the real ones. Sorry that I don't know how to do that in CF but I hope the technique is useful to you.

━╋う一瞬間旳綻放 2024-09-15 19:32:51

无论您使用哪种解决方案,在处理之前在服务器端进行数据验证始终是一个好主意。

这篇文章可能会有所帮助:http://www.bennadel.com/blog/405-Fully-Accessible-Spam-Form-Submission-Blocking-Using-ColdFusion-And-X-HTML-Version-III- .htm

Its always a good idea to do data validation on the server side before processing no matter which solution you use.

This post may help: http://www.bennadel.com/blog/405-Fully-Accessible-Spam-Form-Submission-Blocking-Using-ColdFusion-And-X-HTML-Version-III-.htm

调妓 2024-09-15 19:32:51

使用计算方法怎么样?就像 8 + 5 = ?

或者

使用 ColdFusion.Ajax.submitForm 怎么样?

How about using calculation method? Just like 8 + 5 = ?

OR

how about using ColdFusion.Ajax.submitForm?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文