-
Dec 11th, 2014, 09:38 AM
#1
Thread Starter
Fanatic Member
[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.
-
Dec 15th, 2014, 01:26 PM
#2
Thread Starter
Fanatic Member
Re: Latest Google reCaptcha
Something up with this forum? There's only one post - a sticky - visible now.
-
Dec 15th, 2014, 02:12 PM
#3
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
-
Dec 15th, 2014, 02:27 PM
#4
Thread Starter
Fanatic Member
Re: Latest Google reCaptcha
-
Dec 19th, 2014, 08:32 AM
#5
Thread Starter
Fanatic Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|