doulin4844 2016-04-18 08:39
浏览 72
已采纳

谷歌重新开始第二次在服务器端验证

I have a form with multiple fields & recaptcha. If one of the fields is invalid when submit button is clicked & recaptcha is valid it submits the form but validates those fields and returns an error message to the user if it failed.

At this stage recaptcha remains checked & validated on frontend. If user fixes the issue on the field that had the error message and resubmits the form the response from recaptcha is false and therefore not validated.

enter image description here

After I enter valid email, I get this:

enter image description here

My function that checks the captcha is this:

enter image description here

on false it results in that error message that is displayed on above screenshot.

  • 写回答

2条回答 默认 最新

  • dua55014 2016-04-18 08:43
    关注

    A recaptcha validation is good only one time.

    You have a couple of possible approaches:

    • Save a session variable that the user has successfully completed the captcha and don't require it to pass validation the second time. Be sure to clear the variable on successful submission, or an attacker could solve once and submit a million times.
    • Redisplay the captcha (using a grecaptcha.render call) and require them to fill it out again if the form submission fails.
    • Don't validate the captcha until all other fields validate first.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

悬赏问题

  • ¥15 MATLAB图片转灰度格式问题
  • ¥15 把h5作品链接复制到自己的账号里
  • ¥15 ensp抓包实验配置
  • ¥15 强化学习算法、MRO
  • ¥15 想要学习一门技术来保证以后能够吃上碗饭,该学什么好
  • ¥100 对这段代码用Astro进行layout,用redhawk进行ir drop 的测试和分析,以及降低ir drop 的方法和实现
  • ¥20 matlab绘冲床平面连杆机构图和仿真,求帮助
  • ¥15 为什么树莓派5b显示禁止连接
  • ¥15 请专家处理报错!基于深度学习的车型分类问题:数据集为包含 10 种车型的图像数据集,分为训练集、验证集和测试集。
  • ¥20 流量太费!寻找便宜的app音视频SDK或平替方案。
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部