Registration Form
//IF Data has been submitted if (! empty($_POST['submit'])) { //assignment from form values extract($_POST); //check that required fields have been filled out if ($honeyp==4 && trim($FIRSTNAME) && trim($LASTNAME) && $STATUS && trim($EMAIL) && trim($ADDRESS) && trim($AFFILIATION) && trim($CITIZENSHIP) && $BANQUET){ //This email will be sent to $to = "brubaker@math.mit.edu"; $cc = "friedber@bc.edu, cahill@math.stanford.edu"; $from = $EMAIL; $sender = $LASTNAME; $re = "Conference Registration from ".$FIRSTNAME." ".$LASTNAME; //build body of email $body = "
\n"; $body .= "Status: $STATUS
\n"; $body .= "First Name: $FIRSTNAME
\n"; $body .= "Last Name: $LASTNAME
\n"; $body .= "Email: $EMAIL
\n"; $body .= "Address: $ADDRESS
\n"; $body .= "Affiliation: $AFFILIATION
\n"; $body .= "Citizenship: $CITIZENSHIP
\n"; $body .= "Attending Banquet: $BANQUET
\n"; $body .= "Dietary Restrictions: $DIET
\n"; $mime_boundary = "-----------MIME_PART-------".md5(time()); $headers = "From: $from\r\n"; $headers .= (isset($cc)) ? "Cc: $cc\r\n" : ""; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\""; $message = "--$mime_boundary\n"; $message .= "Content-Type: text/plain; charset=ISO-8859-1; format=flowed\n"; $message .= "Content-Transfer-Encoding: 7bit\n\n"; $message .= preg_replace(array("/<[^>]*>/","/ /"), "", $body); $message .= "\n\n"; $message .= "--$mime_boundary\n"; $message .= "Content-Type: text/html; charset=ISO-8859-1;\n"; $message .= "Content-Transfer-Encoding: 7bit\n\n"; $message .= "\n"; $message .= "\n"; $message .= "\n"; $message .= "\n$body\n\n\n"; $message .= "\n--$mime_boundary\n"; $sent = mail($to, $re, $message, $headers); $disp_status = ($sent) ? "
Thank you for registering for Automorphic Forms, Representations, and Combinatorics: A Conference in Honor of Daniel Bump.
".date('l F jS\, Y \a\t h:i A')."
" : "There was a problem submitting your review."; print "\n$disp_status\n
\n";
print "\n$body\n
\n";
}else {
//If all fields have not been entered, display error
print"ERROR: Please make sure you filled in all the required fields.
"; } } //IF no data has been submitted, display this form else { ?> } //End?>