$val) { if(is_array($val)) { foreach($val as $k => $v) { $contact_data[$key][$k] = $v; $checked[$key][$v] = "checked='checked'"; } }else{ $contact_data[$key]=htmlspecialchars($val); } } $_POST['act'] = isset($_POST['act']) ? $_POST['act'] : ""; switch($_POST['act']) { case "complete": // if($_SESSION['complete']){ // header("Location: ./"); // exit(); // } $body = parse(CONTACT_AUTOREPLY, $contact_data); //echo $body; send_mail($contact_data['email'], CONTACT_AUTOREPLY_SUBJECT, $body, FROM_CONTACT_EMAIL, FROM_NAME); $body = parse(CONTACT_CHARGES, $contact_data); send_mail(FROM_CONTACT_EMAIL, CONTACT_CHARGES_SUBJECT, $body, FROM_CONTACT_EMAIL, FROM_NAME); $_SESSION['complete']=true; $include_file = "complete.php"; break; case "confirm": $vali->data = $contact_data; $vali->check_items = array( "name"=>array("VALID_NOT_EMPTY"), "email"=>array("VALID_NOT_EMPTY","VALID_IS_EMAIL") ); $error = $vali->VALIDATION($contact_data); if(!$vali->err_flag){ $include_file = "form.php"; }else{ $include_file = "confirm.php"; } break; default: unset($_SESSION['complete']); $include_file = "form.php"; } ?>