Coder Social home page Coder Social logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 7, 2024
if you still need assistance, visit site:

http://www.usaidit.com/?p=254

I believe the individual used classic asp with limited coding for recaptcha.

Original comment by [email protected] on 13 Aug 2009 at 7:19

from recaptcha.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 7, 2024
I can't get this to work with ASP at all (I'm a nube) - I've read:

http://www.google.co.uk/url?sa=t&source=web&cd=2&ved=0CCMQFjAB&url=http%3A%2F%2F
www.captcha.net%2F&ei=k18sTLeyJo-WsQbe3a26Ag&usg=AFQjCNGCzSZAYOAGJ-RnHlt9tDk43MU
8Ag&sig2=xj4mIS4yH0eAjCwhPtJbCA 

http://groups.google.com/group/recaptcha/msg/187b6f7a32f4cbe4

and

http://wiki.recaptcha.net/index.php/Overview#Classic_ASP

the latter seemed the most promising, but it didn't work either...

methinks some server side installation is neccessary... 

best find a simpler solution!!


Original comment by [email protected] on 1 Jul 2010 at 9:45

from recaptcha.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 7, 2024
1. Save the following code as recaptcha.asp.

<%
  recaptcha_challenge_field  = Request("recaptcha_challenge_field")
  recaptcha_response_field   = Request("recaptcha_response_field")

  recaptcha_public_key       = "your public key"
  recaptcha_private_key      = "your private key"

  ' returns the HTML for the widget
  function recaptcha_challenge_writer()
  recaptcha_challenge_writer = _
  "<div class='row1'>Please enter the following text in the Captcha field:</div>" & _
  "<div class='row2'>" & _
  "<script type=""text/javascript"">" & _
  "var RecaptchaOptions = {" & _
  "   theme : 'clean'," & _
  "   tabindex : 0" & _
  "};" & _
  "</script>" & _
  "<script type=""text/javascript"" src=""https://www.google.com/recaptcha/api/challenge?k=" & recaptcha_public_key & """></script>" & _
  "<noscript>" & _
    "<iframe src=""https://www.google.com/recaptcha/api/noscript?k=" & recaptcha_public_key & """ frameborder=""1""></iframe><>" & _
      "<textarea name=""recaptcha_challenge_field"" id=""recaptcha_challenge_field"" rows=""3"" cols=""40""></textarea>" & _
      "<input type=""hidden"" name=""recaptcha_response_field"" id=""recaptcha_response_field"" value=""manual_challenge"">" & _
  "</noscript>" & _
  "</div>"

'"<script type=""text/javascript"" 
src=""https://api-secure.recaptcha.net/challenge?k=" & recaptcha_public_key & 
"""></script>" & _

  end function

  ' returns "" if correct, otherwise it returns the error response
  function recaptcha_confirm(rechallenge,reresponse)
  Dim VarString
  VarString = _
          "privatekey=" & recaptcha_private_key & _
          "&remoteip=" & Request.ServerVariables("REMOTE_ADDR") & _
          "&challenge=" & rechallenge & _
          "&response=" & reresponse

  Dim objXmlHttp
  Set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
  objXmlHttp.open "POST", "http://www.google.com/recaptcha/api/verify", False
  objXmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  objXmlHttp.send VarString
  Dim ResponseString
  ResponseString = split(objXmlHttp.responseText, vblf)
  Set objXmlHttp = Nothing

  if ResponseString(0) = "true" then
    'They answered correctly
     recaptcha_confirm = ""
  else
    'They answered incorrectly
     recaptcha_confirm = ResponseString(1)
  end if

  end function

recaptcha_response_field)
%>

2. include recaptcha.asp at the top of the form.asp.
<!--#include file="recaptcha.asp"-->

3. add the following at the end of your form
<% 
    if server_response <> "" or newCaptcha then
        if newCaptcha = False then 
            response.write "<!-- An error occurred --> Wrong!"
        end if
        response.write recaptcha_challenge_writer()
    else
        response.write "<!-- The solution was correct --> Correct!"
    end if
%>

4. in the form handler add the following code
if server_response <> "" or newCaptcha then
   response.write "Please enter the words shown in the reCeptcha field."
   response.write "<p><a href='javascript:history.go(-1);'>Go back</a></p>"     
else
   newCaptcha = False

   ' collect your form data here
end if

Original comment by [email protected] on 17 Apr 2012 at 3:06

from recaptcha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.