reCAPTCHA Classic ASP Implementation

Posted by WorldofCode on Apr 2nd, 2008
2008
Apr 2

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.

 

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

 

 

View Similar Posts

 

5 Responses

  1. Neil Says:

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

  2. WorldofCode Says:

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

  3. Stephany Says:

    Thanks for posting this!

  4. cactusPlant Says:

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

  5. thanks Says:

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

Leave a Comment




XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.