I am trying to validate the recaptcha form on localhost but it is always returning true irrespective of whether I have ticked the checkbox or not. Is this the right behavior?
My form script
<div class="g-recaptcha" data-sitekey="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI"></div>
My server
$secret_key = "6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe";
$request = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret_key.'&response='.$_POST['g-recaptcha-response']);
$response = json_decode($request);
var_dump($response->success);
if($response->success==1){
echo "Success";
die();
}else{
echo "Fail";
die();
}
The keys I am using is default key pair to test with the localhost