Answer the question
In order to leave comments, you need to log in
Why does reCAPTCHA not work correctly?
I install reCAPTCHA on the site under Drupal, entered all the codes for the domain that are given on the site for captcha interaction. But here is the problem. He always gives out that the entered code is not correct. With no exceptions.
Created a function to check the correctness of the entered code.
function valid_capcha()
{
$privatekey = "6LfSl-sSA***ALK3p-*****_Yx4gZ*******v4c";
$resp = recaptcha_check_answer($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
return false;
} else {
return true;
}
}
$validate = valid_capcha();
if ($validate)
{
drupal_mail_send($message);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question