我们在以下URL上有一个实时reCaptcha v2实施:
https://och.stonybrook.edu/index.php?page=roommates&task=submit
reCaptcha一直运行良好,直到向我报告今天不工作。
我确定了以下内容:
我有:
我不知道为什么<textarea>
没有将其数据发布到服务器。
我已经将文档爬到https://developers.google.com/recaptcha/docs/verify都没有用。
HTML:
<!-- Using the Auto Render implementation as described in
https://developers.google.com/recaptcha/docs/display#auto_render -->
<!-- in <head> -->
<script src="https://www.google.com/recaptcha/api.js"></script>
<!-- in <form> -->
<div class="g-recaptcha" data-sitekey="SITE_KEY"></div>
PHP:
echo($_POST['g-recaptcha-response']); //outputs nothing
var_dump($_POST); //outputs all of my form values, except for <textarea id="g-recaptcha-response">
该表格很可能格式错误,例如HTML标记不匹配。检查chrome中的内容,并确保该表格环绕在验证码文本区域周围。