close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Captcha accepting random entries

Thread began 9/19/2010 5:56 pm by Badger | Last modified 9/21/2010 2:27 pm by Jason Byrnes | 1623 views | 15 replies |

Badger

Captcha accepting random entries

Hi

I've had an ongoing issue with Captcha accepting any entry on a particular form. I've got it working on other forms but not with the form attached. I think it might be an order issue as it's in a "show if" and below an "add to cart" button. I'm sure the fact it's using FormMail shouldn't be a problem.

Any ideas?

B

Attached Files
Items_Detail.php.zip
Sign in to reply to this post

Jason ByrnesWebAssist

  I'm sure the fact it's using FormMail shouldn't be a problem.  




The fact that it's using FormMail _is_ the problem
.
to use FormMail, the forms action must be set to post to a different page.

All server side procession of form data MUST occur on the action page.

Captcha validation is performed server side. since the action of the page goes to another page, the captcha validation server behavior never has an opportunity to process the form.

Sign in to reply to this post

Badger

Hi Jason

I tried it using UE without FormMail, It returns to the same page with ?invalid=true at the end. And no email sent.

This is the same page but both show regions missing. That suggests the show region utility is causing a problem?

I can get the captcha to work on it's own on a test page, just not in the "show region" and with the add to cart button.

B

Attached Files
Items_Detail.php.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the ?invalid=true on the end means validation is failing. we need to know which validation is failing.


find:

php:
if ($WAFV_Errors != "")  {

    PostResult($WAFV_Redirect,$WAFV_Errors,"ItemsDetail");
  }




and change it to:

php:
if ($WAFV_Errors != "")  {

    die($WAFV_Errors);
    PostResult($WAFV_Redirect,$WAFV_Errors,"ItemsDetail");
  }




this will tell us what is not working.

Sign in to reply to this post

Badger

11, The Captcha.

Sign in to reply to this post

Jason ByrnesWebAssist

lets find out whats in the session and the post


php:
if ($WAFV_Errors != "")  {

    die($WAFV_Errors."||".$_POST["Security_group_Enter_characters_from_image"]."||".$_SESSION["captcha_Security_group_Enter_characters_from_image"]);
    PostResult($WAFV_Redirect,$WAFV_Errors,"ItemsDetail");
  }
Sign in to reply to this post

Badger

A correct Captcha entry works and sends an email.

In incorrect entry returns:

,11||sfdgsdgsfg||5ZnWD

when the Captcha image says: 5ZnWD

Sign in to reply to this post

Jason ByrnesWebAssist

  A correct Captcha entry works and sends an email.  




I'm not sure i understand the problem then, I though you where saying that captcha doesn't work?

Sign in to reply to this post

Badger

I've messed around with the code so much I'm not sure where I'm at but the situation is now that if the correct Captcha is entered it works OK. BUT

If I change the code back to

php:
if ($WAFV_Errors != "")  { 
    PostResult($WAFV_Redirect,$WAFV_Errors,"ItemsDetail"); 
  }



and enter a random Captcha entry I get the Items_Detail.php?invalid=true page without any form and buy button.

Which makes sense as the show region recordset criteria are not being met.

I'm thinking it would it be better to have a button in the show region on the items detail linking off to a clean form.

Sign in to reply to this post

Jason ByrnesWebAssist

OK, now it makes sense.

so if the captcha fails, the recordet is empty (The record is what you are using for the show region)

easy fix.

add a hidden field to the form to capture the itemID querystring that is used by the recordset:

php:
<input id="ItemID_fields" name="ItemID" type="hidden" value="<?php echo((isset($_GET["ItemID"])?$_GET["ItemID"]:"")); ?>" />





then change the validation failed redirect to pass the ItemID quersyting:
$WAFV_Redirect = "Items_Detail.php?invalid=true&ItemID=".isset($_POST['ItemID'])?$_POST['ItemID']:"";

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...