Previous Article
ASP Classic Linkify - Convert text links into Clickable URLs
No Captcha ReCaptcha 2.0 with ASP Classic
Next Article
ASP Classic play YouTube videos on your page
Coding Article #: 75 - Published On: January 21, 2015 @ 15:01:24 PM - Last Updated on: January 21, 2015
This article has been Favorited 97 times
Join today, and add this to your favorites.
Coding Source - Share on MySpace Coding Source - Share With Facebook Coding Source - Share on Twitter Coding Source - Share on Reddit Coding Source - Share on Digg It Coding Source - Share on Stumble Upon It Coding Source - Share on Delicious
Share With Friends (Updated 6-8-2010)

Supported Files
File Download:
carrzkiss_030441Google_reCaptcha2.zip
File Size: 3.34 KB
Unzip with
Download winzip today!(OR)
Screenshot of Source Code
Coding Source - No Captcha ReCaptcha 2.0 with ASP Classic
Google's new No Captcha ReCaptcha 2.0 with ASP Classic integration will allow everyone that is running ASP Classic for their websites, to have this wonderful new tool to add to their arsenal, to help combat bots and to slow down spammers.

Credit to: Shahid Shaikh
http://codeforgeek.com/2014/12/google-recaptcha-tutorial/#comment-22585
For his response, that got me pointed in the right direction.

View Demo Page«
(Downloadable Files are available for Members Only. there are 3 files available)
First, we need to add the JS to our head tag.
<script src='https://www.google.com/recaptcha/api.js'></script>

Next, we add our form.

<form class="form-3 pics Setwidth" name="ContactForm" action="3.asp" method="post" onsubmit="xmlhttpPost('3.asp', 'ContactForm', 'Contactdiv', '<img src=\'graph/pleasewait.gif\'>'); return false;">
<label>Name</label>
<input type="text" name="name" />
<div class="g-recaptcha" data-sitekey="YOUR-SITEKEY-GOES-HERE"></div>
<input type="Submit" name="Submit" value="Send Message"  style="width:150px;"/></div>
</form><div id="Contactdiv></div>

You will need to the new reCaptcha 2.0 Site Key for this.
Go here: https://www.google.com/recaptcha/admin
Add a new Site Key for your website.
For local testing, you will have to test with
127.0.0.1/site.asp
It will not work with a static IP Address, or with localhost anymore.

Next, we add in our code for the processing page.
3.asp

<%
strname = request.Form("name")
captcha = request.Form("g-recaptcha-response")
if strname = "" then
response.Write "Please provide your name"
'next, we are going to challange the reCaptcha, to make sure that it is not blank, 
'and there is NO way around this. If it is not blank, then we send them a message.
elseif captcha="" then
 response.Write "You have not completed the <strong>reCAPTCHA</strong><br />Please click on the blank box, <br />and fill in the sequence of characters.<br />Thanks You"
else ' If the user has completed the reCaptcha, then we send a message letting them know.
response.Write "Thank you for trying out the <br /><strong>ASP Classic / Jquery reCAPTCHA 2.0</strong> demo."
end if
%>
Post to Facebook about: No Captcha ReCaptcha 2.0 with ASP Classic