close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Captcha won't validate

Thread began 12/19/2014 2:10 pm by JBWebWorks | Last modified 12/23/2014 11:31 am by Jason Byrnes | 1039 views | 7 replies |

JBWebWorks

Captcha won't validate

Inserting Captcha on a second form on a different page and can't get the captcha to validate. Should the second form captcha generate a different session than the first form?

Sign in to reply to this post

Jason ByrnesWebAssist

it may.

look in the code for the captcha image, one of the arguments will be named field, this is used to set the name of the captcha variable as:
captcha_<field name>

Sign in to reply to this post

JBWebWorks

thanks Jason.

I have the second page with the captcha field named Security_Code_2 and session named captcha_Security_Code_2
and validation as
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_Code_2"]))?$_POST["Security_Code_2"]:"") . "",$_SESSION['captcha_Security_Code_2'] . "",true,11);

This is my captcha
<img id="capt1" src="webassist/captcha/wavt_captchasecurityimages.php?width=200&height=50&field=Security_Code_2&bgcolor=FFFFFF&transparent=0&bgimage=&gridfreq=20&gridcolor=0000ff&gridorder=behind&noisefreq=20&noisecolor=0000ff&noiseorder=behind&characters=5&charheight=&font=fonts/MOM_T___.TTF&textcolor=3399ff" alt="security code" width="200" height="50" /><br>
<input id="Security_Code_2" name="Security_Code_2" type="text" value="" />
<br>





<?php
if (ValidatedField('quotation_178','quotation_178')) {
if ((strpos((",".ValidatedField("quotation_178","quotation_178").","), "," . "11" . ",") !== false || "11" == "")) {
if (!(false)) {
?>
<span class="style2">Code entered did not match</span>
<?php //WAFV_Conditional quotation.php quotation_178(11:)
}
}
}?>

It will not validate the captcha?

On another note, I noticed that since i upgraded to databridge and use email form, when i upload with Dreamweaver ftp i get this message

Connections - error occurred - Access denied. The file may not exist locally, may be open in another program, or there could be a local permission problem.

I don't have request connection on this page?

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

JBWebWorks

Jason,

I actually have it working now, but to tell you the truth, I don't know why.
The first page worked fine until I set up the captcha for the second page and then neither worked. So, I totally removed the captcha and the validation for both pages and rebuilt them and now they work.
The validation for page 1
<?php
if (isset($_POST["submit1"]) || isset($_POST["submit1_x"])) {
$WAFV_Redirect = "";
$_SESSION['WAVT_contact_557_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["name1"]))?$_POST["name1"]:"") . "",false,1);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["company1"]))?$_POST["company1"]:"") . "",false,2);
$WAFV_Errors .= WAValidateEM(((isset($_POST["email1"]))?$_POST["email1"]:"") . "",true,3);
$WAFV_Errors .= WAValidatePN(((isset($_POST["phone1"]))?$_POST["phone1"]:"") . "",true,false,true,4);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["address1"]))?$_POST["address1"]:"") . "",false,5);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["city1"]))?$_POST["city1"]:"") . "",false,6);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["state1"]))?$_POST["state1"]:"") . "",false,7);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["comments1"]))?$_POST["comments1"]:"") . "",false,8);
$WAFV_Errors .= WAValidateLE(strtolower(((isset($_POST["Security_Code_1"]))?$_POST["Security_Code_1"]:"")) . "",strtolower($_SESSION['captcha_Security_Code_1']) . "",true,9);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"contact_557");
}
}
?>

The validation for page 2
<?php
if (isset($_POST["submit1"]) || isset($_POST["submit1_x"])) {
$WAFV_Redirect = "";
$_SESSION['WAVT_quotation_178_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["firstname"]))?$_POST["firstname"]:"") . "",false,1);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["lastname"]))?$_POST["lastname"]:"") . "",false,2);
$WAFV_Errors .= WAValidateEM(((isset($_POST["email1"]))?$_POST["email1"]:"") . "",true,3);
$WAFV_Errors .= WAValidatePN(((isset($_POST["phone1"]))?$_POST["phone1"]:"") . "",true,false,true,4);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["address1"]))?$_POST["address1"]:"") . "",false,5);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["city1"]))?$_POST["city1"]:"") . "",false,6);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["state1"]))?$_POST["state1"]:"") . "",false,7);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["zip1"]))?$_POST["zip1"]:"") . "",false,8);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["services1"]))?$_POST["services1"]:"") . "",false,9);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["businessname"]))?$_POST["businessname"]:"") . "",false,10);
$WAFV_Errors .= WAValidateLE(strtolower(((isset($_POST["Security_Code_1"]))?$_POST["Security_Code_1"]:"")) . "",strtolower($_SESSION['captcha_Security_Code_1']) . "",true,11);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"quotation_178");
}
}
?>

The captcha field name/id is the same for both pages and the session is the same name. I must have done something out of sequence when they would not validate before?

On another note, something strange, maybe due to the server, HostGator, but the email that i set up for both pages would not send until i changed the from email to an address with the same domain name.

Sign in to reply to this post

Jason ByrnesWebAssist

Ok, glad to hear it is working.

"On another note, something strange, maybe due to the server, HostGator, but the email that i set up for both pages would not send until i changed the from email to an address with the same domain name."

This is very common. Most hosts will require that the from address be a valid address for your domain. if you use a from address that is not from the domain, the SMTP Server will see the message as being spam.

Sign in to reply to this post

JBWebWorks

Thanks for your support, Jason.
Merry Christmas and Happy New Year to all at webassist!!!

Sign in to reply to this post

Jason ByrnesWebAssist

You're welcome.

Happy Holidays to you as well.

Sign in to reply to this post

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...