if ($_POST["action"] == "proc_reg") { ?>
//var_dump($_POST); ?>
$message = "Castle Wars Equestrian Pre-Registration\n\n";
$message .= "SCA Name: ";
$message .= $_POST["sca_name"] . "\n";
$message .= "Modern Name: ";
$message .= $_POST["modern_name"] . "\n";
$message .= "Membership #: ";
$message .= $_POST["mem_num"] . "\n";
$message .= "Expiration: ";
$message .= $_POST["mem_exp"] . "\n";
$message .= "Current Authorization: ";
if ($_POST["curr_auth"]) {
$i = 0;
foreach ($_POST["curr_auth"] as $ca) {
$message .= $ca;
$i++;
if ($i < count($_POST["curr_auth"])) {
$message .= ", ";
}
}
} else {
$message .= "None";
}
$message .= "\n";
$message .= "Expiration: ";
$message .= $_POST["auth_exp"] . "\n";
$message .= "Upgrade Authorization: ";
if ($_POST["new_auth"]) {
$i = 0;
foreach ($_POST["new_auth"] as $na) {
$message .= $na;
$i++;
if ($i < count($_POST["new_auth"])) {
$message .= ", ";
}
}
} else {
$message .= "None";
}
$message .= "\n";
$message .= "Activities: ";
if ($_POST["activities"]) {
$i = 0;
foreach ($_POST["activities"] as $act) {
$message .= $act;
$i++;
if ($i < count($_POST["activities"])) {
$message .= ", ";
}
}
} else {
$message .= "None";
}
$message .= "\n";
$message .= "Mounted Combat: ";
$message .= $_POST["combat"] . "\n";
$message .= "Day/Date of Arrival: ";
$message .= $_POST["arrival"] . "\n";
$message .= "Number of Horses: ";
$message .= $_POST["num_horses"] . "\n";
$message .= "Horse #1 Name: ";
$message .= $_POST["horse_name_1"] . "\n";
$message .= "Coggins Date: ";
$message .= $_POST["coggins_1"] . "\n";
$message .= "Horse #2 Name: ";
$message .= $_POST["horse_name_2"] . "\n";
$message .= "Coggins Date: ";
$message .= $_POST["coggins_2"] . "\n";
$message .= "Horse #3 Name: ";
$message .= $_POST["horse_name_3"] . "\n";
$message .= "Coggins Date: ";
$message .= $_POST["coggins_3"] . "\n";
$message .= "Horse #4 Name: ";
$message .= $_POST["horse_name_4"] . "\n";
$message .= "Coggins Date: ";
$message .= $_POST["coggins_4"] . "\n";
$to = $equestrian_email . ", " . $eq_deputy_email;
//$to = "ben@houseofpung.net";
$subject = "Castle Wars Equestrian Pre-Registration";
$headers = "From: edila1071@yahoo.com";
// boundary
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
//var_dump($_POST);
//var_dump($_FILES);
if ($_FILES) {
// headers for attachment
$headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
// multipart boundary
$message .= "\n\n--{$mime_boundary}\n" . "Content-Type: text/plain; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n";
$message .= "--{$mime_boundary}\n";
// preparing attachments
$files = $_FILES["uploads"];
for($x=0;$x < count($files["name"]);$x++) {
if ($files["name"][$x] != '') {
$my_file = fopen($files["tmp_name"][$x],"rb");
$data = fread($my_file,$files["size"][$x]);
fclose($my_file);
$data = chunk_split(base64_encode($data));
$message .= "Content-Type: {\"application/octet-stream\"};\n" . " name=\"" . $files["name"][$x] . "\"\n" .
"Content-Disposition: attachment;\n" . " filename=\"" . $files["name"][$x] . "\"\n" .
"Content-Transfer-Encoding: base64\n\n" . $data . "\n\n";
$message .= "--{$mime_boundary}\n";
}
}
}
// send
if (mail($to, $subject, $message, $headers)) {
echo("
Your pre-registration has been submitted!
");
} else {
echo("
There was a problem sending your pre-registration. Please go back and try again. If you continue to have this problem, please email your information directly to the marshals.
");
}
?>
} else { ?>
} ?>