Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Google reCaptcha problem

Google reCaptcha problem

Google reCaptcha problem


I have a Web form which sends without me checking the 'I'm not a Robot' box.

I have Google's <script src='https://www.google.com/recaptcha/api.js'></script> between my <head> tags and

<div class="g-recaptcha" data-sitekey="******></div> in the <form> tags.

What is not right here, please?


RE: Google reCaptcha problem

Impossible to say from that code. How is the form implemented?

When is the captcha being checked?

Where are you stopping the form from being sent?

This is also the HTML forum. Perhaps the forum216: Javascript may be a better place.

Phil AKA Vacunita
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech

RE: Google reCaptcha problem

Hello Phil

Thanks for getting back to me.

OK, I will check that forum out.

Thanks again

RE: Google reCaptcha problem

From the html perspective: Just because some tags are inside the <form>...</form> tag it doesn't make them part of the form or hinder their submit. You can also have any html there just as decoration or instruction of the form, it doesn't change the form behaviour.

You seeem to have followed https://developers.google.com/recaptcha/docs/displ...

Referring to https://developers.google.com/recaptcha/docs/verif... the influence of this div tag within your form tag is an automatically added POST variable, when the widget is used. This additional post parameter has to be checked from your server side script (form action). If your form data comes without eg PHOP variable $_POST["g-recaptcha-response"] being set, the user has not used the widget and the submit should be interpreted as not coming from a human user. Even if it's set it should be set true, when the challenge of the widget has been fulfilled. it has to be verified with doing a specific POST request to https://www.google.com/recaptcha/api/siteverify with your secret key, the g-recaptcha-response value and the end user ip.

So in short just adding the div is not the only step to take, there are several more, it's not a simple thing to integrate, as you need a server side script and do some steps.

In short it works this way: The widget is displayed and if the user has fulfilled the challenge an input vaue is added to the html form. So far only Google knows the user is human or not. Your serverside script now needs to verify the value it got from your html form with Google. Google then either confirms, that this user verification challenge response really came from google and the user was verified or not.

Bye, Olaf.

RE: Google reCaptcha problem

Oh, I see.

OK, Olaf I will take a look again at the Google documentation from the links you have sent.

Thanks again!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close