Editing the security settings in Contactus.php
I want to remove the captcha security (but keep the question security intact). What code do I need to remove?
I want to remove the captcha security (but keep the question security intact). What code do I need to remove?
From the contactus.php page, remove the following two code chunks:
line 227 - 249:
<p>
<div class="text"><img src="WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?noisecolor=<?php echo $WAGLOBAL_Captcha_Noise; ?>&bgcolor=<?php echo $WAGLOBAL_Captcha_BG; ?>&textcolor=<?php echo $WAGLOBAL_Captcha_Text; ?>&transparent=<?php echo $WAGLOBAL_Captcha_BG_transparent; ?>&characters=<?php echo $WAGLOBAL_Captcha_Characters; ?>&width=<?php echo $WAGLOBAL_Captcha_Width; ?>&height=<?php echo $WAGLOBAL_Captcha_Height; ?>&font=<?php echo $WAGLOBAL_Captcha_Font; ?>" alt="security code" /></div>
</p>
<p>
<label for="Security_code">Security Code:</label>
<span id="sprytextfield3">
<input name="Security_code" type="text" class="inputValue" id="Security_code" onblur="if (document.getElementById('captchaServerError')) document.getElementById('captchaServerError').style.display='none'" maxlength="40" />
<span class="textfieldRequiredMsg">A value is required.</span>
<span class="textfieldMinCharsMsg">Minimum number of characters not met.</span>
<span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span>
</span>
<?php
if (ValidatedField("contact","contact")) {
if ((strpos((",".ValidatedField("contact","contact").","), "," . "4" . ",") !== false || "4" == "")) {
if (!(false)) {
?>
<span id="captchaServerError" class="textfieldServerError">Your security code entry did not match the image.</span>
<?php //WAFV_Conditional contact.php contact(4:)
}
}
}?>
</p>
and line 25:
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_code"]))?strtolower($_POST["Security_code"]):"") . "",((isset($_SESSION["captcha_1"]))?strtolower($_SESSION["captcha_1"]):"") . "",true,4);
I removed those two blocks of code, and when I saved it - Dreamweaver warned me that there was a SPRY Validation code that was referencing a widget that is no longer there - so it says I need to remove it in order for the page to validate properly. So I removed the code that it pointed me to - which was this:
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "none", {validateOn:["blur"], minChars:5, maxChars:5});
And now the contact page will not let me submit a message. It asks the security question, but when I answer it correctly, it won't accept it. (tried many times). So I put that sprytextfield3 code back in, and tried it, and it does the same thing.
So I don't know what I removed to make this not work, but it's not working.
Here's the code - and this version is at the state after following your instructions. (removed the code you told me to, but not the spry text dw told me to). Can you look at it? Thanks
You can remove that line Dreamweaver is complaining about, but also change line 25:
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_code"]))?strtolower($_POST["Security_question"]):"") . "",((isset($_SESSION["random_answer"]))?$_SESSION["random_answer"]:"") . "",true,5);
to:
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_question"]))?strtolower($_POST["Security_question"]):"") . "",((isset($_SESSION["random_answer"]))?$_SESSION["random_answer"]:"") . "",true,5);
This worked great. Thanks!
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_code"]))?strtolower($_POST["Security_question"]):"") . "",((isset($_SESSION["random_answer"]))?$_SESSION["random_answer"]:"") . "",true,5);
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_question"]))?strtolower($_POST["Security_question"]):"") . "",((isset($_SESSION["random_answer"]))?$_SESSION["random_answer"]:"") . "",true,5);
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.