Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Google reCaptcha problem

Status
Not open for further replies.

Everton1Blue

Technical User
Jun 6, 2014
41
GB
Hello

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

I have Google's <script src=' between my <head> tags and

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

What is not right here, please?

Thanks.
 
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 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
 
Hello Phil

Thanks for getting back to me.

OK, I will check that forum out.

Thanks again
 
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
Referring to 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 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.
 
Oh, I see.

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

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top