Validation Question
I have an eCart generated checkout system. I didn't orginally include any form validation, but went back to add it later.
I have this code on my checkout.php page:
<?php
if (ValidatedField('confirm_021','confirm_021')) {
if ((strpos((",".ValidatedField("confirm_021","confirm_021").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
<p class="validate">You must enter a valid email address</p>
<?php //WAFV_Conditional confirm.php confirm_021(1:)
}
}
}?>
And this code on my confirm page that sends you back to checkout if things don't validate:
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "checkout.php";
$_SESSION['WAVT_confirm_021_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateEM(((isset($_POST["email"]))?$_POST["email"]:"") . "",true,1);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"confirm_021");
}
}
?>
My problem is, when it returns you to the checkout page to fix your invalid entry, it doesn't hold all the entered data in the form so the user has to re-enter all their data. How do I get it to hold the previous entries? Does it have something to do with session variables?