S
S
Satir012017-03-13 22:00:11
PHP
Satir01, 2017-03-13 22:00:11

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>

PHP handler:
<?
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_dumpdoes 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

1 answer(s)
V
VisualIdeas, 2017-03-14
@VisualIdeas

<div class="g-recaptcha" data-sitekey="6LePwCMTAAAAAC7-iXic-yDYGzrvsUS8HX3IrhGM"></div>
<button type="submit">

It should be 2 separate form elements)))
Why infisible?
If I want to submit a form, I have to go through the recaptcha.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question