Posted - 12/12/2017 : 06:36:08
Ok, you need a thanks, landing page for your contact form, but here is what you can do.
Get your site key from google - it's the same site key you would use in your admin. Google actually lets you list multiple websites where you can use this site key.
In the head of your page where your contact form is, add this <script src='https://www.google.com/recaptcha/api.js'></script>
Then anywhere in your form, add the recaptcha feature (usually the last input in your form) <div class="g-recaptcha" data-sitekey="xxxxxxxxxxxx_xxxxxxxxxxx_xxxxxxxxxxx"></div> be sure to insert your site key in that space there....
Then make sure your form is going to a thanks page on submit. example (form name="contactform" method="post" action="contact-thanks.asp")
Lastly, Add the code below to your landing page where your form results are processed. (this is the .asp version) <% If Request.Form("g-recaptcha-response") = "" Then Response.write("<p class=""results"">Sorry, but you did not complete the Captcha to prove you are human.<br />Please go back to try again</p>") Response.End End If %> Form results processed here.....
You should be able to do this check with .php and javascript as well. It's quite simple.
Edited by - dbdave on 12/12/2017 06:39:05
|