是否可以在浏览器中设置一些标志,以便始终获得RECAPTHCA图像挑战?有时当你点击"我不是一个机器人"按钮时,它会给你一个弹出式挑战,例如"点击包含汽车的所有图像",但有时它只是勾选方框并接受你的话事实上,你不是一个机器人.
我想在桌面和移动设备上测试我的工具的UI,并确保弹出的挑战显示并与页面的其他元素进行良好的交互.
换句话说,作为一名开发人员,我希望 Google认为我是一个机器人,因此它总能给我带来视觉挑战.
有没有办法强迫这种行为?
注意:我做了一些研究,但无法找到任何可能产生答案的相关问题或博客文章.
之前有人问过这个问题:新的Google ReCaptcha没有发布/接收'g-recaptcha-response' - 但是没有正确答案.
我有与他完全相同的设置,但代码在这里失败:
if(!$captcha){
exit;
}
Run Code Online (Sandbox Code Playgroud)
所以$captcha=$_POST['g-recaptcha-response']似乎是空的.
新的谷歌recaptcha与复选框服务器端php =这里的第二个答案也似乎不起作用.
有谁知道为什么会发生这种情况?
我想进行验证码验证.
我从recaptcha网站获得密钥,并且已经成功地将公钥加载到挑战的网页.
<script type="text/javascript"
src="http://api.recaptcha.net/challenge?k=<your_public_key>">
</script>
<noscript>
<iframe src="http://api.recaptcha.net/noscript?k=<your_public_key>"
height="300" width="500" frameborder="0"></iframe><br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40">
</textarea>
<input type="hidden" name="recaptcha_response_field"
value="manual_challenge">
</noscript>
Run Code Online (Sandbox Code Playgroud)
我下载了reCaptcha Python插件,但是我找不到任何关于如何使用它的文档.
有没有人知道如何使用这个Python插件?recaptcha-client-1.0.4.tar.gz(md5)
我们最近在我们的网站上添加了reCAPTCHA 2.0,现在我们偶尔会从IE收到有关Java的消息.这是消息:
您正在查看的页面使用Java.有关Java支持的更多信息,请访问Microsoft网站.
我们的网站没有在客户端上使用Java(没有小程序等),所以这是意料之外的.当用户点击"我不是机器人"并且在验证用户之前,这似乎发生了.它只发生在没有安装Java的机器上,并且似乎只发生一次,然后需要重新启动才能再次出现.
有没有其他经历过这个?
我想在不烦扰用户的情况下保护我的jquery按钮免受机器人攻击,所以我想添加google的隐形recaptcha.然而实现并不像我那么容易,我似乎无法做到这一点.如果有人能告诉我它是如何完成的那就太棒了.PS:我在wordpress主题上这样做.
这是文档:
https://developers.google.com/recaptcha/docs/invisible
创建隐形recaptcha:
https://www.google.com/recaptcha/admin#beta
这就是我所拥有的:
HTML:
<button class="acf-get-content-button">Show Link</button>
<div class="fa" id="acf-content-wrapper" data-id="<?php echo $post_id; ?>"></div>
Run Code Online (Sandbox Code Playgroud)
JS:
<script>
(function($) {
$('.acf-get-content-button').click(function(e) {
e.preventDefault();
$('.fa').addClass('fa-cog fa-spin fa-4x');
var $contentWrapper = $('#acf-content-wrapper');
var postId = $contentWrapper.data('id');
$.ajax({
url: "/public/ajax.php",
type: "POST",
data: {
'post_id': postId
},
})
.done(function(data) {
$('.fa').removeClass('fa-cog fa-spin fa-4x');
$contentWrapper.append(data);
$('.acf-get-content-button').removeClass().addClass('.acf-get-content-button')
});
});
$('.acf-get-content-button').mouseup(function() {
if (event.which == 1) {
$(".acf-get-content-button").hide();
}
});
})(jQuery);
</script>
Run Code Online (Sandbox Code Playgroud)
ajax.php
<?php
define('WP_USE_THEMES', false);
require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' );
global $post;
$post_id = …Run Code Online (Sandbox Code Playgroud) 谷歌刚刚发布了他们的recaptcha的新测试版:reCaptcha v3.我试图在我的WordPress登录屏幕中实现这一点.但是它确实在右下角显示了recaptcha徽标(例如:https://www.google.com/recaptcha/intro/v3beta.html),表明脚本已加载我似乎无法触发它.
我做了什么:
1)在我的登录屏幕的标题中排列api脚本(工作)
2)设置一些js来触发验证码
入队
public static function load_login_scripts()
{
wp_enqueue_script( 'recaptchav3', 'https://www.google.com/recaptcha/api.js?render=KEY');
wp_enqueue_script( 'custom-recaptcha', 'somepath/recaptcha.js' );
}
add_action( 'login_enqueue_scripts', array($this, 'load_login_scripts'));
Run Code Online (Sandbox Code Playgroud)
js触发验证码
document.addEventListener("DOMContentLoaded", function(event) {
grecaptcha.ready(function() {
grecaptcha.execute('MYKEY', {action: 'login'}).then(function(token) {
console.log(token);
});
});
});
Run Code Online (Sandbox Code Playgroud)
这确实在控制台中记录了一个(356个字符长)令牌.
很高兴知道
我正在研究一个流浪的开发环境,认为可能是问题但是与api的交互似乎并没有被压制.
我在隐身测试,每次新会话,所以这不是问题.
有人能告诉我我错过了什么吗?
我已经在我的网站上使用了reCAPTCHA一段时间了,我突然意识到它已经停止工作了.reCAPTCHA在那里,但是在正确验证之后,使表单提交失败的响应FAILS.
在客户端控制台上,浏览器出错:
未捕获(承诺)无效加密.
我试图搜索此错误但找不到类似的东西.提交表单后,PHP中的服务器端验证失败.我不确定上面的错误是否相关,但之前没有.
客户端集成的示例页面:
<html>
<head>
<title>reCAPTCHA demo: Simple page</title>
<script src="https://www.google.com/recaptcha/api.js" async defer>
</script>
</head>
<body>
<form action="?" method="POST">
<div class="g-recaptcha" data-sitekey="your_site_key"></div>
<br/>
<input type="submit" value="Submit">
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
服务器端验证PHP:
$response = json_decode(
file_get_contents(
"https://www.google.com/recaptcha/api/siteverifysecret=MY_SECRET&response=".$_POST['g-recaptcha-response']."&remoteip=".$_SERVER['REMOTE_ADDR'] ), true );
if($response['success'] == false){
echo "FAIL";
} else {
//do something
}
Run Code Online (Sandbox Code Playgroud)
我按照这里的说明进行操作.
我有两个单选按钮.当我点击其中一个更改表单字段时,验证码版本1不再显示.
因此,我必须单击刷新按钮以生成新的验证码图像.
<input type="radio" name="data[Form][sv]" id="FormV1" value="1" /> V1
<input type="radio" name="data[Form][sv]" id="FormV2" value="2" checked="checked" /> V2
Run Code Online (Sandbox Code Playgroud)
jquery代码是:
$(document).ready(function () {
$("#FormV1").bind("change", function (event) {
$.ajax({async:true,
beforeSend:function (XMLHttpRequest) {
$('#loading').show();
},
complete:function (XMLHttpRequest, textStatus) {$('#loading').hide()},
data:$("#FormularioSituacaoVeiculo1").closest("form").serialize(),
dataType:"html",
evalScripts:true,
success:function (data, textStatus) {
$("#search").html(data);},
type:"post",
url:"\/mysite\/theurl\/"});
return false;
});
$("#FormV2").bind("change", function (event) {
$.ajax({async:true,
beforeSend:function (XMLHttpRequest) {
$('#loading').show();
},
complete:function (XMLHttpRequest, textStatus) {
$('#loading').hide()
},
data:$("#FormV2").closest("form").serialize(),
dataType:"html", evalScripts:true, success:function (data, textStatus) {
$("#search").html(data);
},
type:"post",
url:"\/mysite\/url\/"});
return false;
});
function showRecaptcha(element) …Run Code Online (Sandbox Code Playgroud) 通常情况下,HTML5表单验证运行之前的submit事件.
有了这个
<form id="myForm">
<input type="text" name="foo" required />
<button type="submit"> Submit </button>
</form>
<script>
$("#myForm").on('submit',function(){
console.log("I'm entering the submit event handler");
});
</script>
Run Code Online (Sandbox Code Playgroud)
如果输入字段为空,则提交事件处理程序不会运行.只有在HTML5验证(required在本例中为属性)已通过时才会触发它.
我希望在HTML5验证之后运行验证码; 为什么我不得不惹恼用户编写验证码,如果以后我会警告他有丢失的字段?首先,我应该强迫用户以正确的方式做所有事情,然后确保它是一个人而不是机器人,恕我直言.
显然,reCaptcha会在其附加的表单上执行某些操作,从而删除HTML5验证功能.
例如,使用最新的Invisible reCaptcha:
<form id="myForm">
<input type="text" name="foo" required />
<button type="submit"
class="g-recaptcha"
data-sitekey="your_site_key"
data-callback='myCallback'> Submit </button>
</form>
<script>
function myCallback(token){
$("#myForm").submit();
}
$("#myForm").on('submit',function(){
console.log("I'm entering the submit event handler");
});
</script>
Run Code Online (Sandbox Code Playgroud)
表格将与空字段一起提交,而不会通知用户其强制性.
有关它为何如此行事的任何线索?有没有办法可以指示reCaptcha在控制之前运行HTML5表单验证?
我们都知道,有时 cloudflare 喜欢检查其客户端访问者,以确保访问者不是真人。安全检查要求我们通过 Google Recaptcha。我想问是否可以使用我们自己的服务器来传递它(即使使用远程服务器并由我们自己回答验证码等)以及如何传递?
recaptcha ×10
javascript ×5
captcha ×3
php ×3
jquery ×2
validation ×2
api ×1
cakephp-2.3 ×1
cloudflare ×1
google-api ×1
html ×1
html5 ×1
plugins ×1
python ×1
security ×1
server ×1
wordpress ×1