我不知道我的代码出了什么问题,我正在使用代码点火器框架,并且已经像这样实现了Recaptcha:
在视图中:<div class="g-recaptcha" data-sitekey="***********************************"></div>
在提交的表单回复页面:
if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response']))
{
$secret = '???*******************************??????';
$verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
$responseData = json_decode($verifyResponse);
if($responseData->success)
{
$succMsg = 'Your registration request has submitted successfully.';
}
else
{
$this->session->set_flashdata('error_msg', 'CAPTCHA Verification Failed');
redirect('User/login_view');;
}
}
尽管实施,但我每天最多获得15封垃圾邮件注册。有什么帮助吗?
reCaptcha(以及其他任何验证码)不会阻止垃圾邮件,只会阻止漫游器使用该表格。有captcha farms位实际工作人员解决验证码。为了防止垃圾邮件注册,验证码必须与其他形式的验证结合使用,例如通过SMS一次性输入密码。