include("php/lib");
function GetTextBody($data) {
$text_body = "\nName: $data[your_name]\n";
$text_body .= "Company Name: $data[comp_name]\n";
$text_body .= "Email: $data[email_addy]\n";
$text_body .= "Web Site: $data[web_site]\n";
$text_body .= "Phone: $data[phone]\n";
$text_body .= "Street Address: $data[street_address]\n";
$text_body .= "Apartment: $data[apartment]\n";
$text_body .= "City: $data[city]\n";
$text_body .= "State: $data[state]\n";
$text_body .= "Zip: $data[zip]\n";
$text_body .= "Tax ID: $data[taxid]\n";
$text_body .= "Comments: $data[comments]\n";
return $text_body;
}
function GetHtmlBody($data) {
$tpl = "tpl/catreq.tpl";
if (is_array($data[ling])){
foreach ($data[ling] AS $myvalue){
$data["check_".$myvalue] = "CHECKED";
}
}
if (is_array($data[dance])){
foreach ($data[dance] AS $myvalue){
$data["check_".$myvalue] = "CHECKED";
}
}
if (is_array($data[hose])){
foreach ($data[hose] AS $myvalue){
$data["check_".$myvalue] = "CHECKED";
}
}
if (is_array($data[store])){
foreach ($data[store] AS $myvalue){
$data["check_".$myvalue] = "CHECKED";
}
}
// $data = StripSlashesArray($data);
return GetMessage(GetTemplate ($tpl),$data);
}
if ($_POST[register]){
$data = $_POST;
$hackflag="OK"; // This is the flag and we set it to OK
if((strlen($data[state]) != 2 )||(stristr($data[comments], 'url='))||(stristr($data[comments], 'www'))||(stristr($data[comments], 'http'))){ // checking the length of state field, and contents of comments field.
$hackflag="NOTOK"; //setting the flag to error flag.
}
if($hackflag <>"OK"){
echo "
$msg
BAD DATA ENTERED - FORM NOT SENT
";
}else{ // all entries look ok... let us proceed with email
if (is_array($data[ling])){
$customer_contact = preg_replace("#_#"," ",Implode(" - ",$data[ling]));
}
// preg_replace("#---$key---#","$vars[$key]",$template)
if (is_array($data[dance])){
$customer_apt_size = preg_replace("#_#"," ",Implode(" - ",$data[dance]));
}
if (is_array($data[hose])){
$customer_apt_size = preg_replace("#_#"," ",Implode(" - ",$data[hose]));
}
if (is_array($data[store])){
$customer_apt_size = preg_replace("#_#"," ",Implode(" - ",$data[store]));
}
$mail_headers = "Mime-version:1.0\r\n";
$mail_headers .= "Content-Type: multipart/alternative; boundary=\"MCPETE_FORM\"\r\n";
$mail_headers .= "Return-Path: $fields[from]";
$mail_headers .= "\r\n";
$mail_headers .= "This message is in Mime format. Since your mail reader does not understand this format, some or all of this message may not be legibile.";
$mail_headers .= "\r\n";
$mymessage = "--MCPETE_FORM\n";
$mymessage .= "Content-Type: text/plain; charset=us-ascii\r\n";
$mymessage .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
$mymessage .= GetTextBody($data);
$mymessage .= "\r\n\r\n";
$mymessage .= "--MCPETE_FORM\n";
$mymessage .= "Content-Type: text/html; charset=us-ascii\r\n";
$mymessage .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
$mymessage .= GetHtmlBody($data);
$mymessage .= "\r\n\r\n";
$mymessage .= "--MCPETE_FORM--";
// $email = "chris@vourtis.com";
// $bcc = "chris@vourtis.com";
$email = "catalog@mcpeteinc.com";
$bcc = "chris@vourtis.com";
$subject = "Catalog Request from $data[comp_name]";
mail($email,$subject,$mymessage,"From: \"$data[your_name]\" <$data[email_addy]>\r\nBcc: $bcc\r\n$mail_headers");
$message = " Thank you!
Your request has been submitted
";
}
}
?>
McPete Sales Inc - Brassiere - Lingerie - Costume Wholesalers
include("include/top.inc"); ?>
|
|
include("include/cats_left_top.inc"); ?>
|
Catalog Request |
|
if (!$message && !$hackflag){ ?>
} else { ?>
= $message ?>
} ?>
|
|
|
include("include/cats_right.inc"); ?>
include("include/copy.inc"); ?>
|