首页 文章

使用<input type =“submit”>在php网站上使用Google隐形验证码

提问于
浏览
1

我目前正在使用谷歌的正常noCaptcha reCaptcha与WordPress插件“密码保护”,它工作正常 . 还有一些游客感到困惑,他们不得不点击“我不是机器人” . 我的sitekey已被谷歌列入其新的隐形reCaptcha .

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

<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="<?php esc_attr_e( 'Log In', 'password-protected' ); ?>" tabindex="100" />

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

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

显示验证码本身,但在解决验证码后,没有任何事情发生 . 这就像我从未提交过按钮或者recaptcha中的回调函数没有正确回答 .

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

1 回答

相关问题