<?php
if(isset($_POST['Requestor'])) {
// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "[email protected]";
$email_subject = "MediaSite Request";
$email_from = "[email protected]";
$error = "Something went wrong, contact Help Desk at 5177";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form your submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
// validation expected data exists
/*if(!isset($_POST['Class_Name']) ||
!isset($_POST['Requestor']) ||
!isset($_POST['Presenter']) ||
!isset($_POST['Recording_Title']) ||
!isset($_POST['Date_Start']) ||
!isset($_POST['Date_End']) ||
!isset($_POST['Start_Time']) ||
!isset($_POST['End_Time']) ||
isset($_POST['Room_Number']) ||
isset($_POST['Internal_external_presentation']) ||
isset($_POST['Student_Presentation']) )
died('We are sorry, but there appears to be a problem with the form your submitted.'); */
$Class_Name = $_POST['Class_Name']; // required
$Requestor = $_POST['first_name']; // required
$Presenter = $_POST['Presenter']; // required
$Recording_Title = $_POST['Recording_Title']; // required
$Date_Start = $_POST['Date_Start']; // not required
$Date_End = $_POST['Date_End']; // required
$Start_Time = $_POST['Start_Time']; // required
$End_Time = $_POST['End_Time']; // required
$Room_Number = $_POST['Room_Number']; // required
$Internal_external_presentation = $_POST['Internal_external_presentation']; // required
$Student_Presentation = $_POST['Student_Presentation']; // required
$Special_Request = $_POST['Special_Request'];
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "Class_Name: ".clean_string($Class_Name)."\n";
$email_message .= "Requestor: ".clean_string($Requestor)."\n";
$email_message .= "Presenter: ".clean_string($Presenter)."\n";
$email_message .= "Recording_Title: ".clean_string($Recording_Title)."\n";
$email_message .= "Date_Start: ".clean_string($Date_Start)."\n";
$email_message .= "Date_End: ".clean_string($Date_End)."\n";
$email_message .= "Start_Time: ".clean_string($Start_Time)."\n";
$email_message .= "End_Time: ".clean_string($End_Time)."\n";
$email_message .= "Room_Number: ".clean_string($Room_Number)."\n";
$email_message .= "Internal_external_presentation: ".clean_string($Internal_external_presentation)."\n";
$email_message .= "Student_Presentation: ".clean_string($Student_Presentation)."\n";
$email_message .= "Special_Request: ".clean_string($Special_Request)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
<!-- include your own success html here -->
Thank you for contacting the Harrisburg University Help Desk. We will be in touch with you very soon.
<?
}
?>
|