使用 jquery 验证验证验证码

发布于 2024-09-10 16:11:48 字数 77 浏览 4 评论 0原文

我们如何使用 jquery 验证来验证验证码。避免使用ajax回发?谁能帮我解决这个问题吗?我们将不胜感激您的帮助。

谢谢。

How can we validate captcha using jquery validation. avoiding post back using ajax? Can anyone please help me on this. Your help would be appreciated.

Thank you.

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

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

发布评论

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

评论(3

暗地喜欢 2024-09-17 16:11:48

您确实不能这样做,因为在大多数情况下,在服务器端生成的图像将其验证码密钥存储在会话中,您无法直接从客户端访问该会话。

我什至不想考虑从安全角度来看,如果您所要求的实际上有除使用 Ajax 之外的解决方案,那么可能会发生什么。

You really can't do this, because in most cases the image that gets generated on the server-side stores it's CAPTCHA key in a session, which you cannot access directly from the client side.

I don't even want to think of what could be possible from a security perspective if what your asking actually has a solution other than using Ajax.

淡水深流 2024-09-17 16:11:48

验证码测试的目的之一是评估远程端是否有人。如果您允许在客户端上进行检查,您计划如何让客户端告诉服务器验证失败?
您将如何防止攻击者伪造该信号?
(或者您只是想替换 AJAX?)

One of the purposes of the CAPTCHA test is to assess that there is a human sitting at the remote end. If you allow the checking to be done on the client, what's your plan for how the client should tell the server that the verification failed?
How will you prevent that signal from being forged by an attacker?
(Or is it just AJAX you want to replace?)

━╋う一瞬間旳綻放 2024-09-17 16:11:48

如果我理解正确的话,您正在寻求帮助进行 ajax 回发来验证验证码测试,也许只是措辞不够雄辩。

jquery 文档中有一个关于如何使用远程验证来验证验证码的工作示例,这样,如果验证失败并且验证实际上在服务器上执行,则验证插件不会提交表单。理应如此。

请参阅下文:

http://docs.jquery.com/Plugins/Validation#Using_remote_validation_to_help_with_captchas

希望对拉赞有所帮助。

If I understand you correctly, you ARE asking for assistance in doing an ajax postback to validate a CAPTCHA test, perhaps just not phrased eloquently.

There is a working example in the jquery docs of how to use remote validation to validate CAPTCHA, this way the validation plugin takes care of not submitting the form if that validation fails and the validation is actually performed on the server. As it should be.

See below:

http://docs.jquery.com/Plugins/Validation#Using_remote_validation_to_help_with_captchas

Hope that helps Razan.

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