View Full Version : Errors Right Out of the Box
johnlanglois
09-16-2009, 08:19 AM
I finally decided to use the Contact Form Solution Pack because I need the CAPTCHA technology for a client. Imagine my surprise when I opened the form and immediately saw errors relating to the validation aspects of the form.
Surely, it's not supposed to be like this.
I tried to give DW8 a chance to fix things and it gives an error message that says "Please select a form with WA Server Validation applied." Alas, the server validation code show to be in the form.
Am I going to have to remove all the validation and rebuild this form to get it to work?
Jason Byrnes
09-16-2009, 10:33 AM
No, there should not be errors relating to the validation.
What where the errors?
Where you opening the page in Dreamweaver or in a web browser?
With the contact form solution pack, you will only need to edit the WA_Globals.php file, then upload everything to your web server.
johnlanglois
09-16-2009, 12:21 PM
No, there should not be errors relating to the validation.
What where the errors?
Where you opening the page in Dreamweaver or in a web browser?
With the contact form solution pack, you will only need to edit the WA_Globals.php file, then upload everything to your web server.
I wish that were the case.
Without opening the contactus.php file in DW8, I supplied the variables for the Globals, put the files to the testing server and got a form that looks like it could work, if only the CAPTCHA image had shown up, so that the user would know what characters to type in.
So, that's error number 1,
Upon opening the contactus.php file, DW flags all of the Validation showif fields and when I double click on those to repair them, I get the message "Please select a form with WA Server Validation Applied."
That's error #2.
When I double click on WA_Server Validations, it loads up and makes the following changes to what was supposed to have been working code.
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "";
$_SESSION['WAVT_contact_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
Gets changed to :
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "";
$_SESSION['WAVT_contactus_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
which makes things look like a session variable got renamed to reflect the file name.
Perhaps the original file was just contact.php
So at this point, I will strip all the validation out and rebuild the form.
However, I really need WA to suggest a remedy for why the CAPTCHA code is not showing up.
Also, could you explain the logic for the testing that occurs on the security question.
I may settle for just that, if I can't get CAPTCHA to work.
The validation code reads
((isset($_POST["Security_question"]))?strtolower($_POST["Security_question"]):"")
Looks for a like entry on
((isset($_SESSION["random_answer"]))?strtolower($_SESSION["random_answer"]):"")
Which gets set by a call to "WA_ValidationToolkit/WAVT_CaptchaSecurityQuestion.php"
The mystifying code in the form appears to be a client side check with
<span id="sprytextfield4">
<input name="Security_question" type="text" class="inputValue" id="Security_question" onblur="if (document.getElementById('securityServerError')) document.getElementById('securityServerError').sty le.display='none'" maxlength="40" />
<span class="textfieldRequiredMsg">A value is required.</span></span>
Why is that code necessary? It looks like the session var has already been set and that the validation routine would work without the client side check.
Thanks.
Jason Byrnes
09-16-2009, 01:35 PM
If the captcha code is not appearing on the page, then the GD Library is not enabled on your PHP server.
See the "How to enable the GD Library on your Testing Server" tutorial in the how to section of the contact form solution pack support page:
http://www.webassist.com/support/contact-form/
are the contact form files at the root of Dreamweaver Site you are using?
To be able to edit the server behaviors, the files will need to be extracted to the root of your site, if they are extracted to a subfolder of your site, it will not work.
johnlanglois
09-16-2009, 05:28 PM
If the captcha code is not appearing on the page, then the GD Library is not enabled on your PHP server.
See the "How to enable the GD Library on your Testing Server" tutorial in the how to section of the contact form solution pack support page:
http://www.webassist.com/support/contact-form/
are the contact form files at the root of Dreamweaver Site you are using?
To be able to edit the server behaviors, the files will need to be extracted to the root of your site, if they are extracted to a subfolder of your site, it will not work.
Nice to know that code was hard wired to the root.
As far as the GD Library, my phpinfo says
"gd GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.9
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled "
Is there a diagnostic routine I could run?
Thanks
Jason Byrnes
09-17-2009, 12:05 PM
try loading the file that generates the captcha image directly.
The file is WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php
so if go to http://mydomain.com/contactus.php to get the contact for, change that to:
http://mydomain.com/WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php
See if you get an error message.
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.