Answer the question
In order to leave comments, you need to log in
Why is google recaptcha invisible not working?
Good afternoon!
I decided to put an invisible recaptcha on the site. I put it, but it does not work, the form is not sent, but the captcha icon appeared on the site.
FORM itself:
<script src='https://www.google.com/recaptcha/api.js'></script>
<form class="form_faq" action="/forms/send/order-test.php" method="post" style="background: #ECF0F1;padding: 15px 20px;text-align: center;">
<label for="name" >Представьтесь, пожалуйста:</label>
<input class="input" id="name" required="" placeholder="" name="name_TEST" autocomplete="name" type="text" value="" >
<label for="tel" Телефон или Email:</label>
<input class="input" id="tel" required="" placeholder="" name="tel_TEST" autocomplete="tel" type="text" value="" >
<label for="comments">Комментарии:</label>
<textarea class="area" id="comments" placeholder="" name="comments_TEST"></textarea>
<button type="submit" class="g-recaptcha input_submit" data-sitekey="6LevqRgUAAAAAEX2W3x8ZOh47Zw31TpPdqPVfHg-" data-callback="YourOnSubmitFn" tabindex="4">Заказать!</button>
</form>
<?
if(isset($_POST['g-recaptcha-response']) && $_POST['g-recaptcha-response']) {
$secret = "***************************";
$ip = $_SERVER['REMOTE_ADDR'];
$response = $_POST['g-recaptcha-response'];
$rsp = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=$secret&response=$response&remoteip=$ip");
var_dump($rsp);
};
?>
var_dump
does not return, so far I have set captcha 2.0 (it works).
Answer the question
In order to leave comments, you need to log in
<div class="g-recaptcha" data-sitekey="6LePwCMTAAAAAC7-iXic-yDYGzrvsUS8HX3IrhGM"></div>
<button type="submit">
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question