Results 1 to 5 of 5

Thread: [RESOLVED] Latest Google reCaptcha

  1. #1

    Thread Starter
    Fanatic Member coox's Avatar
    Join Date
    Oct 1999
    Posts
    550

    Resolved [RESOLVED] Latest Google reCaptcha

    I'd really like to use the latest Google reCaptcha in an ASP website but it seems beyond me, and I can't find any really helpful info out there.

    I'd like to show the reCaptcha in a page that contains a contact form which is then submitted to another (invisible) ASP page that sends an email, dependant, of course, upon the captcha.
    Nick Cook
    VB6 (SP6)

  2. #2

    Thread Starter
    Fanatic Member coox's Avatar
    Join Date
    Oct 1999
    Posts
    550

    Re: Latest Google reCaptcha

    Something up with this forum? There's only one post - a sticky - visible now.
    Nick Cook
    VB6 (SP6)

  3. #3
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: Latest Google reCaptcha

    Not that it's germane to your issue... but check the forum display options at the bottom of the forum listing... there's default filters that are used ti filter out old threads. Just need to open them up a bit. I see roughly 10 threads based on my current filtering settings.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Fanatic Member coox's Avatar
    Join Date
    Oct 1999
    Posts
    550

    Re: Latest Google reCaptcha

    Ohhhh! Thanks!
    Nick Cook
    VB6 (SP6)

  5. #5

    Thread Starter
    Fanatic Member coox's Avatar
    Join Date
    Oct 1999
    Posts
    550

    Cool Re: Latest Google reCaptcha

    Just in case anyone's ever interested, this is how I solved my problem.
    Having followed Google's instructions for getting their widget to display properly on my contact page, I then added the following code goes in the page that the "action" property of my public-facing form points to:
    Code:
        Dim mySecret, strResponse, strUserIP, strURL, booSuccess, arrSuccess
        'Initial settings
        mySecret = "put the Secret Key from Google here"
        myResponse = Request.form("g-recaptcha-response")
        strUserIP = Request.ServerVariables("REMOTE_ADDR")
        strURL = "https://www.google.com/recaptcha/api/siteverify?secret=" & mySecret & "&response=" & myResponse & "&remoteip=" & strUserIP
        'Get a response from Google
        set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") 
        xmlhttp.open "GET", strURL, false 
        xmlhttp.send "" 
        arrSuccess = Split(xmlhttp.responseText, Chr(10))
        set xmlhttp = nothing 
        'Comprehend the response
        For each myLine in arrSuccess
         If InStr(myLine,"success") And InStr(myLine, "true") Then booSuccess = True
        Next
    
        If booSuccess Then 
         Response.Write "<p>Hoorah! You're a human!!!</p>" & vbCrLf
        Else
         Response.Write "<p>Get thee gone, foul droid!!!</p>" & vbCrLf
        End If
    Nick Cook
    VB6 (SP6)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width