"Application", ); //Setup aliases for all of the various form elements for every possible form and the order in which they need to be displayed $form_fields = array( "name" => "Name: ", "email" => "E-Mail: ", "subject" => "Subject: ", "homephone" => "Home Phone:", "permaddy" => "Permenent Address: ", "bgsuaddy" => "Bowling Green Address ", "hsname" => "High School Name ", "rank" => "Class Rank:", "cumgpa" => "Cumulative GPA:", "results" => "SAT/ACT Results: ", "act1" => "High School and College Activities: ", "act2" => "Extra-Cirricular Activities: ", ); if (!$HTTP_POST_VARS["form_title"]) die("form name must be identified for validation and submission"); //Get the title of the current form $form_title = $form_types[$HTTP_POST_VARS["form_title"]]; //Start the body of the message $form_contents = "This " . $form_title . " was submitted via the Alpha Sigma Phi form-mailer:\n\n"; $break_set = false; ### Make complete message body ### $form_contents .= "---------------------------------------\n"; $form_contents .= "Remote IP address: $REMOTE_ADDR\n"; $form_contents .= "Browser: $HTTP_USER_AGENT\n"; $today = date("l dS of F Y h:i:s A"); $form_contents .= "Date and Time Submitted: $today\n"; //Loop through each form element and if it matches above, copy it to the buffer foreach ($form_fields as $field => $desc) { if (($desc == "break") && ($break_set == false)) { $form_contents .= " \n"; $break_set = true; } elseif ($HTTP_POST_VARS[$field]) { $form_contents .= " " . $desc . $HTTP_POST_VARS[$field] . "\n"; $break_set = false; } } //This is where it pulls all of the information from the form fields, and formats the e-mail as well. if (!mail("gilln@bgnet.bgsu.edu, ", "Alpha Sigma Phi: " . $form_title, $form_contents, "From: " . $HTTP_POST_VARS["name"] . "<" . $HTTP_POST_VARS["name"] . ">")) die("Could not process the form, please submit a request to the webmaster."); echo "Thank you for submitting your application to Alpha Sigma Phi for the 'Better the Man Scholarhip'. It will be reviewed shortly."; ?>