DMXzone reCAPTCHA Support Product Page

This topic is locked
Answered

Validation - Resolved

Asked 03 Dec 2011 03:06:01
1
has this question
03 Dec 2011 03:06:01 David Stoltz posted:
I'm trying to use the reCaptcha on my form. I do my validation on the receiving page, and if a form value is blank for example, I send all the form values back in the URL.

But when I add the reCaptcha, it doesn't work right...here is my captcha code:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="ScriptLibrary/dmxReCAPTCHA.asp" -->
<
%Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If

' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<
%' DMXzone reCAPTCHA 1.0.1
Dim theCAPTCHA
Set theCAPTCHA = new dmxReCAPTCHA
theCAPTCHA.PrivateKey = "6LfXxsoSAAAAAAAZo5b6k3hNKxssGSOKiIvCTW4Q"
theCAPTCHA.PublicKey = "6LfXxsoSAAAAAB0UM7Zm56JXZ1CmP4bmcIjNjlvG"
theCAPTCHA.Construct
%>
<
%if Request.ServerVariables("REQUEST_METHOD") = "POST" then 
   If eval("vartype(MM_abortEdit)") = 0 or (Not MM_abortEdit) Then 
     Response.Redirect "get-started-submit.asp" 
   end if
 end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

etc...
...

Here is my form code:

<form name="form1" action="get-started.asp" method="post">
<input name="fname" type="text" class="Selectcustom" id="fname" maxlength="25" value="<%=request("fname")%>" />
<input name="lname" type="text" class="Selectcustom" id="lname" maxlength="35" value="<%=request("lname")%>" />
etc...
etc...
</form>

Promoted Answers

Replied 03 Dec 2011 08:22:43
You'll need to do it all via the same dynamically generated page (script), that's a requirement to ensure the script always opens a two way handshake with the Google server (to draw the object or parse its sent content).

In other words the forms action=url must be to itself. The DMXZone bods also mention that somewhere.

Without that you might as well not use the captcha at all.

When the Google server causes a response to the form object it is your code logic that should include the captcha true / false result as just another layer of your whole form validation.

Regards.

Edited by - R W on 03 Dec 2011  08:25:39

Replies

Replied 03 Dec 2011 08:22:43
03 Dec 2011 08:22:43 R W replied:
You'll need to do it all via the same dynamically generated page (script), that's a requirement to ensure the script always opens a two way handshake with the Google server (to draw the object or parse its sent content).

In other words the forms action=url must be to itself. The DMXZone bods also mention that somewhere.

Without that you might as well not use the captcha at all.

When the Google server causes a response to the form object it is your code logic that should include the captcha true / false result as just another layer of your whole form validation.

Regards.

Edited by - R W on 03 Dec 2011  08:25:39
Replied 03 Dec 2011 15:03:40
03 Dec 2011 15:03:40 David Stoltz replied:
Ohhh! I get it...

I just had to move my validation from the receiving page to the same page as the form...

Got it...thanks!

Reply to this topic