Answer the question
In order to leave comments, you need to log in
How to connect reCAPTCHA correctly?
Registered captcha. How to implement the correct integration on the client and server side?
Simply inserted into the form div
. Will it work this way submit
? How to link submit
and captcha?
<div class="g-recaptcha" data-sitekey=""></div> <button type="submit" class="btn btn-xl" value="submit">ОТПРАВИТЬ</button>
Answer the question
In order to leave comments, you need to log in
recaptcha accepts get requests
$url = 'https://www.google.com/recaptcha/api/siteverify?secret=YOU_SECRET_KEY&response='.(array_key_exists('g-recaptcha-response', $_POST) ? $_POST["g-recaptcha-response"] : '').'&remoteip='.$_SERVER['REMOTE_ADDR'];
$resp = json_decode(file_get_contents($url), true);
if ($resp['success'] == true) {
//все хорошо
}
else {
// капча не решена
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question