close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

How can I incorporate the show if server behavior in an existing PHP script?

Thread began 3/30/2016 2:36 am by markhaynes75235 | Last modified 4/05/2016 2:47 pm by markhaynes75235 | 313 views | 12 replies

markhaynes75235

Originally Said By: Ray Borduin
  Did you add the validate field to the jquery form submit? I'm afraid I'm getting a little lost about where it is failing and why at this point.

You can try adding debug code to the validation... but since you are using jquery for the form submit I'm not quite clear on how the server validation is going to work.

Maybe write the values when the server validation is run to see if they have the values you would expect:


$WAFV_Errors .= WAValidateLE($_SESSION['captcha_Security_Code_1'] . "",$_POST['verify'] . "",true,1);
die($_SESSION['captcha_Security_Code_1'].":".$_POST['verify']);  




Thanks, Ray:

The validation seems to be fine as the values returned when I write the ($_SESSION['captcha_Security_Code_1'].":".$_POST['verify']); per your instructions are: w2hWd:12345, where the first value is the code displayed in the CAPTCHA graphic and the second is the value I entered. The problem seems to have to do with the way the alert is written to the page after the validation fails. See lines 87 - 95 of the contact.php page:

} else if (ValidatedField('contact_413','contact_413')) {
if((strpos((",".ValidatedField("contact_413","contact_413").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
echo '<div class="error_message">Attention! The CAPTCHA code you entered is incorrect.</div>';
//WAFV_Conditional contact.php contact_413(1:)
exit();
}
}
}

Looking at the other validations, for instance lines 84 - 86 show the correct alert if the CAPTCHA field is empty:

} else if (trim($verify) == '') {
echo '<div class="error_message">Attention! Please enter the CAPTCHA code.</div>';
exit();

Of course it's easy to check to see if the field is empty.

I look forward to your insight into this issue.

enthusiastically,
Mark

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