【问题标题】:Google invisible captcha on a php website with <input type="submit">带有 <input type="submit"> 的 php 网站上的 Google 隐形验证码
【发布时间】:2016-12-13 22:44:29
【问题描述】:

我目前正在使用来自谷歌的普通 noCaptcha reCaptcha 和 WordPress 插件“密码保护”,它工作正常。仍然有一些访问者对他们必须点击“我不是机器人”感到困惑。我的站点密钥已被 Google 列入其新的隐形 reCaptcha。

我在提交按钮中添加了必要的参数:

&lt;input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large g-recaptcha" data-sitekey="mySiteKey" data-callback="" data-badge="inline" value="&lt;?php esc_attr_e( 'Log In', 'password-protected' ); ?&gt;" tabindex="100" /&gt;

并且响应通过以下方式验证:

if ( ( $this-&gt;encrypt_password( $password_protected_pwd ) == $pwd &amp;&amp; $pwd != '' &amp;&amp; isset($_POST['g-recaptcha-response']) &amp;&amp; $_POST['g-recaptcha-response'] ) || apply_filters( 'password_protected_process_login', false, $password_protected_pwd ) ) {

验证码本身已显示,但在解决验证码正确后,没有任何反应。就像我从来没有提交过按钮或者recaptcha中的回调函数没有正确回答一样。

那么,我做错了什么?或者我必须在代码中更改什么?

【问题讨论】:

    标签: php wordpress callback recaptcha


    【解决方案1】:

    必须设置回调函数,否则表单无法提交。

    查看此答案了解更多详情。

    https://stackoverflow.com/a/41147377

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-01-02
      • 2013-09-07
      • 2015-11-14
      • 2011-03-31
      • 2011-01-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多