write session after validation
hi,
for my checkout form i have inserted some SS formvalidations.
In the form i use also a eC_SameAs checkbox to copy the values from billing to delivery inputs. The copy Process works fine. But after the validation the values from the input fields that have been copied from the eC_SameAs have not been written into my sessions.
Can anybody help?
Here is some code:
<?php require_once("WA_ValidationToolkit/WAVT_Scripts_PHP.php"); ?>
<?php require_once("WA_ValidationToolkit/WAVT_ValidatedForm_PHP.php"); ?>
<?php
$XOX_Shop->GetContent();
?>
<?php
$_SESSION["re_plz"] = (ValidatedField("checkoutstep1","postcode"));
$_SESSION["re_stadt"] = (ValidatedField("checkoutstep1","city"));
$_SESSION["re_strasse2"] = (ValidatedField("checkoutstep1","street2"));
$_SESSION["re_strasse1"] = (ValidatedField("checkoutstep1","street1"));
$_SESSION["re_fax"] = (ValidatedField("checkoutstep1","fax"));
$_SESSION["re_telefon"] = (ValidatedField("checkoutstep1","phone"));
$_SESSION["re_email"] = (ValidatedField("checkoutstep1","email"));
$_SESSION["re_name"] = (ValidatedField("checkoutstep1","lastname"));
$_SESSION["re_vorname"] = (ValidatedField("checkoutstep1","firstname"));;
if(isset($_POST['eC_SameAs'])&&($_POST['eC_SameAs'] == true)) {
$_SESSION["li_plz"] = (ValidatedField("checkoutstep1","postcode"));
$_SESSION["li_stadt"] = (ValidatedField("checkoutstep1","city"));
$_SESSION["li_strasse2"] = (ValidatedField("checkoutstep1","street2"));
$_SESSION["li_strasse1"] = (ValidatedField("checkoutstep1","street1"));
$_SESSION["li_fax"] = (ValidatedField("checkoutstep1","fax"));
$_SESSION["li_telefon"] = (ValidatedField("checkoutstep1","phone"));
$_SESSION["li_email"] = (ValidatedField("checkoutstep1","email"));
$_SESSION["li_nachname"] = (ValidatedField("checkoutstep1","lastname"));
$_SESSION["li_vorname"] = (ValidatedField("checkoutstep1","firstname"));
} else {
$_SESSION["li_plz"] = (ValidatedField("checkoutstep1","shipping_postcode"));
$_SESSION["li_stadt"] = (ValidatedField("checkoutstep1","shipping_city"));
$_SESSION["li_strasse2"] = (ValidatedField("checkoutstep1","shipping_street2"));
$_SESSION["li_strasse1"] = (ValidatedField("checkoutstep1","shipping_street1"));
$_SESSION["li_fax"] = (ValidatedField("checkoutstep1","shipping_fax"));
$_SESSION["li_telefon"] = (ValidatedField("checkoutstep1","shipping_phone"));
$_SESSION["li_email"] = (ValidatedField("checkoutstep1","shipping_email"));
$_SESSION["li_nachname"] = (ValidatedField("checkoutstep1","shipping_lastname"));
$_SESSION["li_vorname"] = (ValidatedField("checkoutstep1","shipping_firstname"));
}
?>
<?php
//WA eCart Redirect Check Out
if (isset($_POST["XOX_Shop_Checkout_1_x"]) || isset($_POST["XOX_Shop_Checkout_1"])) {
$Redirect_redirStr="checkout_step2.php";
if ($Redirect_redirStr != "") {
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
if (strpos($Redirect_redirStr, "?") === false) {
$Redirect_redirStr .= "?".$_SERVER['QUERY_STRING'];
}
else {
$Redirect_redirStr .= "&".$_SERVER['QUERY_STRING'];
}
}
$XOX_Shop->redirStr = $Redirect_redirStr;
}
$XOX_Shop->cartAction = "Checkout";
}
?>
<?php
// WA eCart Redirect
if ($XOX_Shop->redirStr != "") {
header("Location: ".$XOX_Shop->redirStr);
}
?>
AND HERE an extract from THE FORM:
<div class="eC_FieldsetWrapper">
<h3 class="eC_CheckoutFormHeader">Lieferadresse</h3>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="eC_SameAsWrapper" >
<tr>
<td><input type="checkbox" name="eC_SameAs" id="eC_SameAs" value="1" onClick="eCart_copyBillingToShipping(this); toggle('box')" style="width:auto;" /></td>
<td><label for="eC_SameAs">Lieferadresse entspricht der Rechnungsadresse</label></td>
</tr>
</table>
<br /><div id="box">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<th><label for="shipping_firstname" >Vorname*</label></th>
<td><input type="text" name="shipping_firstname" id="shipping_firstname" value="<?php echo $_SESSION['li_vorname']; ?>" />
<span class="Stil1">
<?php
if (ValidatedField("checkoutstep1","checkoutstep1")) {
if ((strpos((",".ValidatedField("checkoutstep1","checkoutstep1").","), "," . "7" . ",") !== false || "7" == "")) {
if (!(false)) {
?>
PFLICHTFELD
<?php //WAFV_Conditional checkout_step1.php checkoutstep1(7:)
}
}
}
?>
</span></td>
</tr>
<tr>
<th><label for="shipping_lastname" >Nachname*</label></th>
<td><input type="text" name="shipping_lastname" id="shipping_lastname" value="<?php echo $_SESSION['li_nachname']; ?>" />
<span class="Stil1">
<?php
if (ValidatedField("checkoutstep1","checkoutstep1")) {
if ((strpos((",".ValidatedField("checkoutstep1","checkoutstep1").","), "," . "8" . ",") !== false || "8" == "")) {
if (!(false)) {
?>
PFLICHTFELD
<?php //WAFV_Conditional checkout_step1.php checkoutstep1(8:)
}
}
}
?>
</span></td>
</tr>
<tr>
<th><label for="shipping_email" >Emailadresse*</label></th>
<td><input type="text" name="shipping_email" id="shipping_email" value="<?php echo $_SESSION['li_email']; ?>" />
<span class="Stil1">
<?php
if (ValidatedField("checkoutstep1","checkoutstep1")) {
if ((strpos((",".ValidatedField("checkoutstep1","checkoutstep1").","), "," . "9" . ",") !== false || "9" == "")) {
if (!(false)) {
?>
PFLICHTFELD
<?php //WAFV_Conditional checkout_step1.php checkoutstep1(9:)
}
}
}
?>
</span></td>
</tr>
<tr>
<th><label for="shipping_phone" >Telefonnummer</label></th>
<td><input type="text" name="shipping_phone" id="shipping_phone" value="<?php echo $_SESSION['li_telefon']; ?>" /></td>
</tr>
<tr>
<th><label for="shipping_fax" >Faxnummer</label></th>
<td><input type="text" name="shipping_fax" id="shipping_fax" value="<?php echo $_SESSION['li_fax']; ?>" /></td>
</tr>
<tr>
<th><label for="shipping_street1" >Straße*</label></th>
<td><input type="text" name="shipping_street1" id="shipping_street1" value="<?php echo $_SESSION['li_strasse1']; ?>" />
<span class="Stil1">
<?php
if (ValidatedField("checkoutstep1","checkoutstep1")) {
if ((strpos((",".ValidatedField("checkoutstep1","checkoutstep1").","), "," . "10" . ",") !== false || "10" == "")) {
if (!(false)) {