DMXzone reCAPTCHA Support Product Page

This topic is locked
Answered

reCaptcha not working

Asked 31 Jan 2012 23:04:36
21
have this question
31 Jan 2012 23:04:36 Glenn Peters posted:
I've purchased & installed this program and the reCaptcha displays correctly but unfortunately the form can be processed without verification. The form also uses Dreamweaver spry text validation.

Official Answer

Replied 20 Mar 2013 08:43:35
Hi All,

First, sorry that I've missed this topic. It seems it was market as solved.

Next - this is an old topic which we have addressed with a big update of the DMXzone reCaptcha extension Version 1.1, so the code solution is not needed any more.

So please make sure you install the latest version 1,1 first.

Then you can enter your followup url in the DMXzone reCaptcha dialog. After validating Go To field, instead of entering it as form action.

So please try this and preferably on a new created page.

If you still have problems please report to this new topic:

www.dmxzone.com/support/19386/topic/57580/

Greetings,
George

Replies

Replied 01 Feb 2012 08:51:37
01 Feb 2012 08:51:37 Vulcho Vulev replied:
Hello Glenn Peters.

Can you provide us with link to your page where you are receiving the problem ?

Take a look also at the following F.A.Q :
Validation Message does not appear

Regards: V.Vulev
Replied 01 Feb 2012 19:19:57
01 Feb 2012 19:19:57 Glenn Peters replied:
Vulcho,

Thanks for your reply - please see:

trustydelivery.co.nz/refer_a_friendform_recaptcha.php

Regards,

Glenn.
Replied 01 Feb 2012 19:23:09
01 Feb 2012 19:23:09 Glenn Peters replied:
When all fields are correct then page should be directed to:

trustydelivery.co.nz/refer_a_friendform2_recaptcha.php

Regards,

Glenn.
Replied 01 Feb 2012 19:35:20
01 Feb 2012 19:35:20 Glenn Peters replied:
Also, the PHP validation code for the rest of the form (FormToEmail by FormToEmail.com) is on trustydelivery.co.nz/refer_a_friendform2_recaptcha.php
Replied 01 Feb 2012 20:10:51
01 Feb 2012 20:10:51 Glenn Peters replied:
There is no problem with the reCaptcha itself (see: trustydelivery.co.nz/form_test.php). However complications arrive incorporating reCaptcha into the form that has Dreamweaver spry text validation as well as the ability to send contents to an email address/addresses with FormToEmail.
Replied 03 Feb 2012 03:38:36
03 Feb 2012 03:38:36 liz banbury replied:
Hi I'm also having this problem.
I've put the reCaptcha into my form just above the 'submit' button.
However I also can successfully submit a form if I enter the wrong letters into the box. No validation or error message to 'try again' comes back.

many thanks
Replied 03 Feb 2012 07:26:52
03 Feb 2012 07:26:52 Teodor Kuduschiev replied:
Hello All,

You need to make sure your form is using method="POST" and action="action_url_goes_here" points to your current page!

Your action should not point to another page!
Replied 03 Feb 2012 07:44:06
03 Feb 2012 07:44:06 liz banbury replied:
Correct. My form is using POST and just points to itself.
Replied 03 Feb 2012 07:45:56
03 Feb 2012 07:45:56 Vulcho Vulev replied:
Hello Liz Banbury.

Can you provide us with link to the problem page ?
Replied 03 Feb 2012 07:50:03
03 Feb 2012 07:50:03 liz banbury replied:
And I agree with Glenn. It works fine on its own, but doesn't validate when part of a bigger 'signup' or registration form.
Replied 06 Feb 2012 07:03:51
06 Feb 2012 07:03:51 liz banbury replied:
Hi Just to add the reCaptcha works if other fields in your form are incorrect and need to be amended, but as soon as all the rest of the form is correct then the form will submit even if the reCaptcha wording does not match.
Is there anything in captcha.php I need to tweak?
Replied 06 Feb 2012 07:33:01
06 Feb 2012 07:33:01 Vulcho Vulev replied:
Hello all.

Please note that the recaptcha needs to direct to the page where the extension is installed when the form submits.

QuoteYou need to make sure your form is using method="POST" and action="action_url_goes_here" points to your current page!

Your action should not point to another page!


Liz Banbury did you changed the code according the following F.A.Q. ?

Validation Message does not appear

Can you provide us with link to your page?

Regards: V.Vulev
Replied 06 Feb 2012 07:43:43
06 Feb 2012 07:43:43 liz banbury replied:
Hi Vulcho
I sent you a link to your email (as it has a login on it)
Many thanks for getting back to me. Yes I did look at the FAQ page above.

I do not have a thankyou page though and I don't want to be directed to any page.

Are you saying that for it all to work I need to go to another page?

In my current page I validate: usual text inputs for first name, last name etc. Then some validation for password and email addresses, then if all fields correctly filled in a record is inserted into a database table and the user is sent an email w/activation link in it.

The captcha works unless it is the only thing which has been input incorrectly. Then the whole form submits anyway.

Many thanks for the help. Really appreciate it.
Replied 06 Feb 2012 07:45:19
06 Feb 2012 07:45:19 Glenn Peters replied:
Guys I'm back on this in the morning so looks like a bit of catching up! Hope we can sort issues. Regards, Glenn.
Replied 06 Feb 2012 07:46:00
06 Feb 2012 07:46:00 liz banbury replied:
Hi Vulcho

If I view my source this is what I have at the point of insertion:

<script type="text/javascript">var RecaptchaOptions = {theme : "white",lang : "en",tabindex : 0};</script>
<script type="text/javascript" src="www.google.com/recaptcha/api/challenge?k=6Le5Js0SAAAAAA9pEeS4BSEoGTCmJumZ0hUcWp00"></script>
<noscript>
<iframe src="www.google.com/recaptcha/api/noscript?k=6Le5Js0SAAAAAA9pEeS4BSEoGTCmJumZ0hUcWp00" height="300" width="500" frameborder="0"></iframe><br/>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
</noscript>
Replied 06 Feb 2012 20:20:55
06 Feb 2012 20:20:55 Glenn Peters replied:
My problem is twofold in that the Dreamweaver spry text validation code is in the "refer_a_friendform_recaptcha.php" page (that also has an external javascript file SpryValidationTextField.js), however the code for processing the form (FormToEmail from FormToEmail.com) is in the refer_a_friendform2_recaptcha.php page. The complication here is that the DMXzone reCaptcha needs to point to the current page so a conundrum! So in summing up, if the reCaptcha is entered incorrectly then the error message appears (as it should) but all the other fields are erased. If the whole form is entered correctly then you are directed to "trustydelivery.co.nz/refer_a_friend2_recaptcha.php?" with the error message"Not Found

The requested URL /refer_a_friend2_recaptcha.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at trustydelivery.co.nz Port 80". Can you help please? This is doing my head in! Ideally I would like it to have the same behavior as "www.dmxzone.com/demo/php/reCAPTCHA/index.php" as when I saw this & came across DMXzone reCaptcha I thought it would be perfect for this. Hope it also helps with Liz's situation.

Many Thanks,

Glenn.
Replied 06 Feb 2012 23:40:42
06 Feb 2012 23:40:42 liz banbury replied:
Hi Vulcho

What does this bit of code exactly mean?
if (!isset($mm_abort_edit) || !$mm_abort_edit)

I think if I add a line for reCaptcha, the same as for all my other field validation..i.e. if reCaptcha 'not working' then echo 'error message' otherwise.....continue to insert a record into the database....then this might help?

Many thanks
Replied 07 Feb 2012 03:33:08
07 Feb 2012 03:33:08 liz banbury replied:
So along the lines of all my other validation then I think it will work:

This validation does not seem to work though....

if(!isset($mm_abort_edit) || !$mm_abort_edit) { // and validation is not fine
      // Return Error - Invalid captcha 
       echo '<p class="maintextactive">The validation words entered do not match the images, please try again.<br /></p>';  
	   found_error == "True";
	}

Replied 07 Feb 2012 04:13:36
07 Feb 2012 04:13:36 liz banbury replied:
OK I'll be a bit more specific....

I have a list of field validations (please see code below) which all work fine.
When I add the reCaptcha - I added a validation for the captcha.
This is because at the moment if the test entered into the captcha is correct, then the form submits, even if other fields are empty or incorrect.

HOw can I stop the form submitting when the captcha is correct but other fields are not correct.

I do now want to go to another page either.

many thanks for the help. really appreciated.

Please see the end bit of some field validations and the recaptcha validation at the end.....

In theory if found_error != 'Yes' then the form won't submit, but it does if the captchas is correct.

if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $reg_email)){  
      // Return Error - Invalid Email  
       echo '<p class="maintextactive">The email you have entered is invalid, please try again.<br /></p>';  
	   found_error == "True";
    }

	if (empty($secA)) {
		echo '<p class="maintextactive">You must choose a security question and answer.<br /></p>';
		found_error == "True";
	}
	
	if(isset($mm_abort_edit) || $mm_abort_edit) { // and validation is not fine
      // Return Error - Invalid captcha 
       echo '<p class="maintextactive">The validation words entered do not match the images, please try again.<br /></p>';  
	   found_error == "True";
	}
	
		   
	 if ((found_error != "True") && ($password1 == $password2))   {
	   


Replied 10 Feb 2012 08:32:57
10 Feb 2012 08:32:57 liz banbury replied:
p.s. I have added the piece of code you suggest in the 'Validation Message does not appear' link - but the form still submits if the recaptcha is correct but other fields have been incorrectly filled. The validation error messages appear, but the form submits

Please see full code with validation and the recaptcha.
All my validation and the form worked perfectly until I added the recaptcha. I really need some help on this.
Many thanks

if (($reg_agent == "Yes") && empty($reg_license)) {
      // We know $reg_agent is Yes AND $reg_license is blank 
	   echo '<p class="maintextactive">You need to enter a license number.<br /></p>';
	   found_error == "True";
	}	
	
	if (($reg_agent == "Yes") && empty($reg_colicense)) {
      // We know $reg_agent is Yes AND $reg_colicense is blank 
	   echo '<p class="maintextactive">You need to enter your company license number.<br /></p>';
	   found_error == "True";
	}	
		   
	
	if  (strlen($username) <6 ){
		echo '<p class="maintextactive">You must enter a username of at least 6 characters.<br /></p>';
		found_error == "True";
	}
	
	if (empty($reg_lname)) {
		echo '<p class="maintextactive">You must enter a surname.<br /></p>';
		found_error == "True";
	}
	
	
	if (empty($reg_fname)) {
		echo '<p class="maintextactive">You must enter a first name.<br /></p>';
		found_error == "True";
	}
	
	if  (empty($password1)) {
		echo '<p class="maintextactive">You must enter a password of minimum 8 characters.<br /></p>';
		found_error == "True";
	}
	
	if ($password1 != $password2) {
		echo '<p class="maintextactive">Both passwords must match. Please try again.<br /></p>';
		found_error == "True";
	}
	
	if (strlen($password1) <8 ) {
	   echo '<p class="maintextactive">Your password must be a minimum of 8 characters and consist of both letters and numbers.<br /></p>';
	   found_error == "True";
	}
		   
	if (!preg_match('/^[0-9]+$/i', $reg_tel) ) {
		echo '<p class="maintextactive">The number you have entered is invalid. Please use numbers only.<br /></p>';  
	    found_error == "True";
	}

		
	if (strlen($reg_tel) <8 ) {
		echo '<p class="maintextactive">Your telephone number must be a minimum of 8 numbers only.<br /></p>';
	   found_error == "True";
	}
	
	if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $reg_email)){  
      // Return Error - Invalid Email  
       echo '<p class="maintextactive">The email you have entered is invalid, please try again.<br /></p>';  
	   found_error == "True";
    }

	if (empty($secA)) {
		echo '<p class="maintextactive">You must choose a security question and answer.<br /></p>';
		found_error == "True";
	}
	
	if($_SERVER['REQUEST_METHOD'] == "POST" ) { // if form is submitted
 	if (!isset($mm_abort_edit) || !$mm_abort_edit) { // and validation is fine
	 $GoTo = "map.htm"; // redirect to a new page
	 if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
 	$GoTo .= (strpos($GoTo, '?')) ? "&" : "?";
 	$GoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
	 }
	 }
	}

		   
	 if ((found_error != "True") && ($password1 == $password2)  && !$mm_abort_edit)   {
	   
	
      // Make sure someone isn't already registered using this username
      $query = "SELECT * FROM DEV_user_registration WHERE username = '$username'";
      $data = mysqli_query($dbc, $query);
      if (mysqli_num_rows($data) == 0) 
	  {
     
	    // The username is unique, so insert the data into the database
        $query = "INSERT INTO DEV_user_registration
Replied 10 Feb 2012 08:34:38
10 Feb 2012 08:34:38 liz banbury replied:
And my form starts off as follows:

 <form action="signup - Copy.php" method="post" enctype="multipart/form-data">
Replied 10 Feb 2012 19:17:11
10 Feb 2012 19:17:11 Glenn Peters replied:
Yes I would like to nail this asap too please! Client is getting a little frustrated... Thanks, Glenn.
Replied 16 Feb 2012 00:47:30
16 Feb 2012 00:47:30 Glenn Peters replied:
Vulcho, I need to get back on to this as still not resolved - can you help please?

Regards,

Glenn.
Replied 16 Feb 2012 05:05:52
16 Feb 2012 05:05:52 liz banbury replied:
Hi Yes I'm still stuck as well.

Many thanks
Replied 17 Feb 2012 21:52:13
17 Feb 2012 21:52:13 Mike Hicks replied:
I've been "stuck" on this one for several months (since the extension was released) I have decided that this extension is "not ready for prime time" and updated my CAPTCHA module from another extension company and plan to replace ReCAPTCHA with CAPTCHA and will wait for the update to see if it is any better.

Reply to this topic