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?
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?
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>
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?
I'll need to troubleshoot directly, see the private message section.
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.
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.
Thanks for your support, Jason.
Merry Christmas and Happy New Year to all at webassist!!!
You're welcome.
Happy Holidays to you as well.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.