close ad
Databridge V2 with MySQLi support IS Now Available!
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 4:24 pm by Steve | Last modified 12/09/2019 2:15 pm by Steve | 103 views | 23 replies

Steve

Yes, understood...

Quick question : Once all the requirements are met and there are no further server side validations outstanding how do I clear the GET from the URL?

As it is now on each resubmit the URL Query is appended to the end of the URL such as :
https://hotellecabanon.com/rates-and-availabilityy?fail=true&fail=true&fail=true

I'm considering checking the ["WAVT_ratesandavailabilityx_815_Errors"] session and if there are no values then redirect to the same page less the URL Query parameter. Good, or is that what the second if for? if ($WAFV_Redirect == "")

<?php 
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$WAFV_Redirect = "rates-and-availabilityy?fail=true";
$_SESSION['WAVT_ratesandavailabilityx_815_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["contactName"])) ? $_POST["contactName"] : "") . "",false,1);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["email"])) ? $_POST["email"] : "") . "", true,2);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["dateArrive"])) ? $_POST["dateArrive"] : "") . "", false,3);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["dateDepart"])) ? $_POST["dateDepart"] : "") . "", false,4);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["personsQty"])) ? $_POST["personsQty"] : "") . "", false,5);

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



UPDATE: Adding the session check did not refresh the page clean:

<?php 
if ($_SERVER["REQUEST_METHOD"] === "POST") {
if($_SESSION["WAVT_ratesandavailabilityx_815_Errors"]!=''){
$WAFV_Redirect = "rates-and-availabilityy?fail=true";
} else {
$WAFV_Redirect = "rates-and-availabilityy";
}
$_SESSION['WAVT_ratesandavailabilityx_815_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["contactName"])) ? $_POST["contactName"] : "") . "",false,1);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["email"])) ? $_POST["email"] : "") . "", true,2);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["dateArrive"])) ? $_POST["dateArrive"] : "") . "", false,3);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["dateDepart"])) ? $_POST["dateDepart"] : "") . "", false,4);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["personsQty"])) ? $_POST["personsQty"] : "") . "", false,5);

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

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