I have this code in my form:
<div class="g-recaptcha" data-sitekey="MY_KEY"></div>
And the validation part:
// Re captcha part
if (isset($_POST['g-recaptcha-response'])){
$captcha = $_POST['g-recaptcha-response'];
}
if (!$captcha) {
redirect('login', 'refresh');
}
$response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=MY_SECRET_KEY&response=".$captcha."&remoteip=".$_SERVER['REMOTE_ADDR']);
// t($response,1);
if($response."success" == false) {
redirect('login', 'refresh');
}
It sort of works now, this is my result:
When I click the checkbox, I still need to type the text for verification.
I thought that clicking the checkbox was enough?
Am I doing something wrong here?