reCAPTCHA Classic ASP Implementation


Recently had to work with a new CAPTCHA program called reCAPTCHA.  It was fairly easy to implement with Classic ASP coCAPTCHA - World of Codede but had some problems figuring out some parts of it.

First off what is CAPTCHA?  It stands for Completely Automated Public Turing test to tell Computers and Humans Apart.  CAPTCHA is basically an image of letters and numbers that is randomly generated.  The image makes it difficult for spam bots to read.  So they can be used as a way to verify if a computer is submitting a form on a website or an actual person.  So we can eliminate all of that pesky spam!

The reCAPTCHA software is free to use and also helps digitize books when it is being used.  Check out their site for more information on that.

I needed to implement this software on a site that runs Classic ASP.  They did not have a specific example on how to do this but I was able to find an example done from a very kind person Andre F. Bruton on the discussion boards.  Click here to go and view the example.

Update it appears that the above site has gone down so here is a link to the example that was offered by that site.

Download the example.

The example worked great I just had to insert the code into my pages and I was off and running in no time.  However on a few of the pages I was running them in SSL which when using the reCAPTCHA software on those page brought up some secure errors.  Through searching around the internet and trying various things I found out that reCAPTCHA has a secure server to send to so you will no longer get the security errors.  That URL is https://api-secure.recaptcha.net

Here is an example of where you need to put it in your code.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function recaptcha_challenge_writer(publickey)
recaptcha_challenge_writer = "<script type=""text/javascript"">" & _
"var RecaptchaOptions = {" & _
" theme : 'white'," & _
" tabindex : 0" & _
"};" & _
"</script>" & _
"<script type=""text/javascript"" src=""https://api-secure.recaptcha.net/challenge?k=" & publickey & """></script>" & _
"<noscript>" & _
"<iframe src=""http://api.recaptcha.net/noscript?k=" & publickey & """ frameborder=""1""></iframe><br>" & _
"<textarea name=""recaptcha_challenge_field"" rows=""3"" cols=""40""></textarea>" & _
"<input type=""hidden"" name=""recaptcha_response_field"" value=""manual_challenge"">" & _
"</noscript>"
end function

7 Responses to “reCAPTCHA Classic ASP Implementation”

  1. Neil April 21, 2008 at 3:48 pm #

    The Andre Burton link for the example code no longer works. Can you post a new link?

  2. WorldofCode April 21, 2008 at 4:01 pm #

    Luckily I saved the zip file that was offered on that page and have made it available for download.

  3. Stephany June 12, 2009 at 8:52 am #

    Thanks for posting this!

  4. cactusPlant August 27, 2009 at 11:27 pm #

    I have code to validate the first name, email etc. All in javascript. How do i implement it with the recaptcha code herein?

  5. Demtron October 29, 2009 at 10:12 am #

    Thanks for this example. Came in handy for a project involving some old Classic ASP code I inherited. I went to the link at andrebruton.com also works now.

  6. thanks November 20, 2009 at 6:25 pm #

    Thanks for saving the code! I had it all except the line to set the header.
    Thanks again :)

  7. davenycity September 15, 2010 at 10:59 am #

    great blog thank you

Leave a Reply


Refresh