This is catalog
\n";
if ($bcc != ''){
$headers .= "Bcc: ".$bcc."\n";
}
$output = $message;
$output = wordwrap($output, 72);
return(mail("\"".$contactname."\" <".$contactemail.">", $subject, $output, $headers));
}
///ERROR CHECKING
unset($_SESSION['error']);
if (isset($_POST['firstname'])) {
$firstname = trim($_POST['firstname']);
if ($firstname == "") {
$ferror = "A first name must be included.";
$k++;
} elseif (!preg_match("/^[a-zA-Z]+$/", $firstname)) {
$ferror = "The first name may consist only of letters (e.g. Jennifer)";
$k++;
}
}
if (isset($_POST['lastname'])) {
$lastname = trim($_POST['lastname']);
if ($lastname == "") {
$lerror = "A last name must be included.";
$k++;
} elseif (!preg_match("/^[a-zA-Z]+$/", $lastname)) {
$lerror = "The last name may consist only of letters (e.g. Johnson)";
$k++;
}
}
if (isset($_POST['title'])) {
$title = trim($_POST['title']);
if ($title == "") {
$terror = "A title must be included.";
$k++;
} elseif (!preg_match("/^([a-zA-Z]|\s)+$/", $title)) {
$terror = "The title may consist only of letters or spaces (e.g. Vice President)";
$k++;
}
}
if (isset($_POST['address'])) {
$address = trim($_POST['address']);
if ($title == "") {
$aerror = "An address must be included.";
$k++;
}
}
if (isset($_POST['city'])) {
$city = trim($_POST['city']);
if ($city == "") {
$cerror = "A city must be included.";
$k++;
} elseif (!preg_match("/^([a-zA-Z]|\s)+$/", $city)) {
$cerror = "The city name may consist only of letters or spaces (e.g. New York)";
$k++;
}
}
if (isset($_POST['state'])) {
$state = trim($_POST['state']);
if ($state == "") {
$serror = "A state must be included.";
$k++;
} elseif (!preg_match("/^([a-zA-Z]|\s)+$/", $state)) {
$serror = "The state name may consist only of letters or spaces (e.g. New York)";
$k++;
}
}
if (isset($_POST['zip'])) {
$zip = trim($_POST['zip']);
if ($zip == "") {
$zerror = "A zip code must be included.";
$k++;
} elseif (!preg_match("/^\S+$/", $zip)) {
$zerror = "The zip code may consist only of letters, numbers, or spaces (e.g. New York)";
$k++;
}
}
if (isset($_POST['phone'])) {
$phone = trim($_POST['phone']);
if ($phone == "") {
$perror = "A phone number must be included.";
$k++;
}
}
if (isset($_POST['country'])) {
$country = trim($_POST['country']);
if ($country == "") {
$coerror = "A zip code must be included.";
$k++;
} elseif (!preg_match("/^([a-zA-Z]|\s)+$/", $country)) {
$coerror = "The country name may consist only of letters or spaces (e.g. New Zealand)";
$k++;
}
}
if (isset($_POST['email'])) {
$regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$";
$email = trim($_POST['email']);
if ($email == "") {
$eerror = "An e-mail address must be included.";
$k++;
} elseif (!preg_match("/" . $regexp . "/", $email)) {
$eerror = "The e-mail address must be properly written (e.g. jennifer@johnson.com)";
$k++;
}
}
///no errors? rock on then....
if ($k == 0) {
if (isset($_POST["email"])) {
$message = "Salutation: " . $_POST["salutation"] . "
";
$message .= "First Name: " . $_POST["firstname"] . "
";
$message .= "Last Name: " . $_POST["lastname"] . "
";
$message .= "Company Name: " . $_POST["cname"] . "
";
$message .= "Title/Occupation: " . $_POST["title"] . "
";
$message .= "Address 1: " . $_POST["address"] . "
";
$message .= "Address 2: " . $_POST["address1"] . "
";
$message .= "City: " . $_POST["city"] . "
";
$message .= "State: " . $_POST["state"] . "
";
$message .= "Zip: " . $_POST["zip"] . "
";
$message .= "Country: " . $_POST["country"] . "
";
$message .= "Phone: " . $_POST["phone"] . "
";
$message .= "Ext: " . $_POST["extnum"] . "
";
$message .= "Fax: " . $_POST["fax"] . "
";
$message .= "Email: " . $_POST["email"] . "
";
$message .= "Interests " . $_POST["interests"] . "
";
if ($_POST['timeframe'] != '') {
$message .= "Time Frame " . $_POST["timeframe"] . " weeks
";
}
$message .= "Budget " . $_POST["budget"] . "
";
$message .= "Quantity " . $_POST["quantity"] . "
";
if ($_POST['promotions'] != '') {
$message .= "Promotions: Yes" . "
";
}
if ($_POST['membership'] != '') {
$message .= "Membership: Yes" . "
";
}
if ($_POST['recognition'] != '') {
$message .= "Recognition: Yes" . "
";
}
if ($_POST['trading'] != '') {
$message .= "Trading: Yes" . "
";
}
if ($_POST['tradeshows'] != '') {
$message .= "Trade Shows: Yes" . "
";
}
if ($_POST['generalbranding'] != '') {
$message .= "General Branding: Yes" . "
";
}
if ($_POST['awards'] != '') {
$message .= "Awards: Yes" . "
";
}
if ($_POST['promotions'] != '') {
$message .= "Promotions: Yes" . "
";
}
if ($_POST['gifts'] != '') {
$message .= "Gifts: Yes" . "
";
}
if ($_POST['hearfrom'] != '') {
$message .= "Hear From " . $_POST["hearfrom"] . "
";
}
$message .= "Other: " . $_POST["other"] . "
";
$message .= "Comments: " . $_POST["comments"] . "
";
if ($_POST['newsletter'] != '') {
$message .= "I don't wish to receive the newsletter.
";
}
if ($_POST['mailinglist'] != '') {
$message .= "I wish to be on the mailing list for special offers.
";
}
send_mail("kk-awards.com","kilbourne@kk-awards.com", "Web", "kilbourne@kk-awards.com", "Website Comments", $message);
$page = "/catalog/thankyou.php";
}
} else {
$_SESSION['error'] = $_POST;
}
}
include($global_document_root . $page);
break;
case "cart":
include($global_document_root."/cart/index.php");
break;
case "promo":
include($global_document_root."/promo/pick_gifts.php");
break;
case "contact":
$page = "/contact.php";
if (isset($_POST['submit_x'])) {
function send_mail($myname, $myemail, $contactname, $contactemail, $subject, $message) {
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "From: \"".$myname."\" <".$myemail.">\n";
if ($bcc != ''){
$headers .= "Bcc: ".$bcc."\n";
}
$output = $message;
$output = wordwrap($output, 72);
return(mail("\"".$contactname."\" <".$contactemail.">", $subject, $output, $headers));
}
///ERROR CHECKING
unset($_SESSION['error']);
if (isset($_POST['firstname'])) {
$firstname = trim($_POST['firstname']);
if ($firstname == "") {
$ferror = "A first name must be included.";
$k++;
} elseif (!preg_match("/^[a-zA-Z]+$/", $firstname)) {
$ferror = "The first name may consist only of letters (e.g. Jennifer)";
$k++;
}
}
if (isset($_POST['lastname'])) {
$lastname = trim($_POST['lastname']);
if ($lastname == "") {
$lerror = "A last name must be included.";
$k++;
} elseif (!preg_match("/^[a-zA-Z]+$/", $lastname)) {
$lerror = "The last name may consist only of letters (e.g. Johnson)";
$k++;
}
}
if (isset($_POST['email'])) {
$regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$";
$email = trim($_POST['email']);
if ($email == "") {
$eerror = "An e-mail address must be included.";
$k++;
} elseif (!preg_match("/" . $regexp . "/", $email)) {
$eerror = "The e-mail address must be properly written (e.g. jennifer@johnson.com)";
$k++;
}
}
///no errors? rock on then....
if ($k == 0) {
if (isset($_POST["email"])) {
$message = "First Name: " . $_POST["firstname"] . "
";
$message .= "Last Name: " . $_POST["lastname"] . "
";
$message .= "Address 1: " . $_POST["address1"] . "
";
$message .= "Address 2: " . $_POST["address2"] . "
";
$message .= "City: " . $_POST["city"] . "
";
$message .= "State: " . $_POST["state"] . "
";
$message .= "Zip: " . $_POST["zip"] . "
";
$message .= "Email: " . $_POST["email"] . "
";
$message .= "Comments " . $_POST["comments"] . "
";
if ($_POST['offers'] != '') {
$message .= "I wish to receive news about special offers.
";
}
send_mail($_POST["firstname"] . " " . $_POST["lastname"],$email, "Web", "kilbourne@kk-awards.com", "Website Comments", $message);
$page = "/thankyou.php";
}
} else {
$_SESSION['error'] = $_POST;
}
}
include($global_document_root . $page);
break;
case "cart":
include($global_document_root."/cart/index.php");
break;
default:
include($global_document_root."/_includes/main_index.php");
break;
}
if(!empty($session)){
include($global_document_root ."/_includes/footer_index.php");
}
else {
include($global_document_root ."/_includes/footer.php");
}
?>