Alright so I’m trying to get captcha to work here and I have this little error detecting thing that looks like this. I’m not going to paste the entire page as that would be way too long, only the essentials
page1
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/include/recaptchalib.php');
echo recaptcha_get_html($reCaptcha_publickey); ?>
<?php echo $_SESSION['devtest'];?>
page2
if (!$resp->is_valid)
{
$_SESSION['devtest'] = $resp->error . "testzzz"; // DEVELOPING, DELETE THIS
$errors = $errors . "'1',";
// Returns errors to page1
}
Now the $errors does have the ‘1’, in it, it echoes the “testzzz” part of devtest fine but it displays no error.
Anyone know what I’m doing wrong? Thanks
EDIT: I followed this guide for the most part, i only changed the code for the if statement https://developers.google.com/recaptcha/docs/php
$resp->erroris what you’re looking for,$resp->is_validis a Boolean value, and I think it’s deprecated since reCaptcha became part of googles main tools so you might be checking a variable that doesn’t exits. so(!$resp->is_valid)always returns TRUE.