close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

server validation

Thread began 5/13/2014 8:12 am by s.joiner74419001 | Last modified 5/20/2014 8:58 am by Jason Byrnes | 1953 views | 10 replies |

s.joiner74419001

server validation

I am trying to manually add server validation to a small form. I am following the "add server validation" tutorial and it is unclear as to what page to add the server behaviour too.. the action page or the form page? although this might seem obvious to add to the forms page I just want to check because after the "Add Form Data" instructions ( which is to the actions page ) it proceeds to the "Configure Validations" instructions bit it does not say to open the form page so it assumes to stay on the action page.. Is this correct?

Plus when adding the server behaviour it gives a syntax error in line 4

below is the code that is added.

<?php require_once("webassist/form_validations/wavt_scripts_php.php"); ?>
<?php require_once("webassist/form_validations/wavt_validatedform_php.php"); ?>
<?php
if () {
$WAFV_Redirect = "apply-for-rtm-private.php";
$_SESSION['WAVT_thankyou_936_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["first_name"]))?$_POST["first_name"]:"") . "",false,1);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["surname"]))?$_POST["surname"]:"") . "",false,2);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["email"]))?$_POST["email"]:"") . "",false,3);

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

Sign in to reply to this post

Jason ByrnesWebAssist

All form processing must be applied to the forms action page.

if the action of the form is to post to another page, then the validation server behavior should go on that other page.

the syntax error at line 4:
if () {

is because no trigger was selected. it should be something like this for any form post:
if($_SERVER["REQUEST_METHOD"] == "POST") {

Sign in to reply to this post

s.joiner74419001

sent private message

Sign in to reply to this post

Jason ByrnesWebAssist

you had not set an action for the form:
<form method="post" id="application_pr" name="application_pr">


by not setting the action, the form was posting to itself.

if you add the validation to the thankyou page, you must set the action to post to the thank you page:
<form method="post" id="application_pr" name="application_pr" action="thankyou.php">

Sign in to reply to this post

s.joiner74419001

Thanks Jason, I've subsequently added an 'Insert Record' behaviour and a 'Download File' behaviour but neither are working. Any idea why?

Sign in to reply to this post

Jason ByrnesWebAssist

using FTP to look at the code for the thankyou.php page, i do not see the code for the insert or download behaviors

Sign in to reply to this post

s.joiner74419001

I think you just answered my query as I had applied them to the form page!

Sign in to reply to this post

Jason ByrnesWebAssist

Since the action of the page is to post to the thank you page, all form processing needs to happen there.

Sign in to reply to this post

s.joiner74419001

Got ya!! Cheers!

Sign in to reply to this post

s.joiner74419001

insert record behaviour not working

Jason, I've added both 'download file' and 'insert record' behaviours and only the 'download file' is working. as well as both working I want to re-direct to the Thankyou page after submit.

Can you see what is wrong here? and why? because all I have done is add both behaviours which Im assuming is all I need to do!

Sign in to reply to this post
loading

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