close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Server Validations losing $_POST values and

Thread began 12/06/2019 1:24 pm by Steve | Last modified 12/09/2019 11:15 am by Steve | 1155 views | 23 replies

Steve

Server Validations losing $_POST values and

Couple questions on Server Validations

1) Is there a reason $_POST values are lost on submission?
The server validation works and displays the missing input value but the $_POST is not retained which requires a filling out the form again.

php:
if ($_SERVER["REQUEST_METHOD"] === "POST")  {

  $WAFV_Redirect = "rates-and-availabilityx.php";
  $_SESSION['WAVT_ratesandavailabilityx_517_Errors'] = "";
  if ($WAFV_Redirect == "")  {
    $WAFV_Redirect = $_SERVER["PHP_SELF"];
  }
  $WAFV_Errors = "";
  $WAFV_Errors .= WAValidateRQ(((isset($_POST["contact-name"]))?$_POST["contact-name"]:"") . "",false,1);
  $WAFV_Errors .= WAValidateRQ(((isset($_POST["email"]))?$_POST["email"]:"") . "",false,2);
  $WAFV_Errors .= WAValidateRQ(((isset($_POST["dateArrive"]))?$_POST["dateArrive"]:"") . "",false,3);
  $WAFV_Errors .= WAValidateRQ(((isset($_POST["dateDepart"]))?$_POST["dateDepart"]:"") . "",false,4);

  if ($WAFV_Errors != "")  {
    PostResult($WAFV_Redirect,$WAFV_Errors,"ratesandavailabilityx_517");
  }
}



<input name="contact-name" type="text" class="form-control order-1"
value="<?php if (isset($_POST['contact-name'])) {
echo $_POST['contact-name'];
} ?>"/>



2) Is there a variable that is present that we can use to show an area (or not) IF there are any outstanding server validations still present?
Looking at the generated code it looks like this is the case to use:

php:
<?php  if (isset($WAFV_Errors) && $WAFV_Errors != "")  { ?>


Just looking for a confirmation that this is the best practice method for a generic conditional showing of a wrapper div.

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