2012-10-30

Here it is Oli

// HANDLE FORM SUBMISSION

if(isset($_POST['customer_email'])) {

// validate required fields (server side validation controlled here - each field contains rules for javascript validation separately)

$requiredTextFields = array('customer_first_name','customer_last_name','customer_phone','customer_address1','customer_city','customer_billing_state','customer_zip');

// shipping fields, if used

if($shipDisplayInfo) {

array_push($requiredTextFields,'customer_ship_name','customer_ship_address1','customer_ship_city','customer_ship_state','customer_ship_zip');

}

// validate username and pw if accounts are enabled

if($module_settings["show_account_info"]) {

array_push($requiredTextFields,'customer_username','customer_password');

}

foreach ($requiredTextFields as $ff) {

// verify some content exists for each field

Line 73  if(!(strlen(trim($_POST[trim($ff)]))) && !(in_array(trim($ff), $_ENV["request.cwpage"]["formErrors"]))) {

$_ENV["request.cwpage"]["formErrors"][] = trim($ff);

}

}

Show more