Registration Successful!

"; echo "

Dear ". $_POST["StudentsFirstName"]. ",

"; echo "

Thank you for applying to represent the ". $_POST["ChapterState"]." ".$_POST["Chapter"]." Chapter of Pi Mu Epsilon at the 2011 MathFest. By Friday, June 17th, you should receive further information regarding the status of your application. In the meanwhile, please do not hesitate to direct any questions to PME Secretary-Treasurer, Professor Paul Fishback, at secretary-treasurer@pme-math.org.

" ; //Start building mail string. $msg1 ="Application Type: ".$_POST["ApplicationType"]. "\n"; $msg1 .="US Citizen: ".$_POST["USCitizen"]. "\n"; $msg1.="First: ".$_POST["StudentsFirstName"]. "\n"; $msg1 .="Last: ".$_POST["StudentsLastName"]. "\n"; $msg1 .="E-Mail: ".$_POST["StudentEmail"]. "\n"; $msg1 .="E-Mail: ".$_POST["CellNumber"]. "\n"; $msg1 .="Permanent Street Address: ".$_POST["PermStreet"]. "\n"; $msg1 .="Permanent City: ".$_POST["PermCity"]. "\n"; $msg1 .="Permanent State: ".$_POST["PermState"]. "\n"; $msg1 .="Permanent Zip: ".$_POST["PermZipCode"]. "\n"; $msg1 .="Summer Street Address: ".$_POST["SummerStreet"]. "\n"; $msg1 .="Summer City: ".$_POST["SummerCity"]. "\n"; $msg1 .="Summer State: ".$_POST["SummerState"]. "\n"; $msg1 .="Summer Zip: ".$_POST["SummerZipCode"]. "\n"; $msg1 .="Chapter State: ".$_POST["ChapterState"]. "\n"; $msg1 .="Chapter: ".$_POST["Chapter"]. "\n"; $msg1 .="Institution: ".$_POST["UniversityAttended"]. "\n"; $msg1 .="Induction Date: " .$_POST["Initiation_Month"]. " of " .$_POST["Initiation_Year"]. "\n"; $msg1 .="Degree: " .$_POST["Degree"]. "\n"; $msg1 .="Major: " .$_POST["Major"]."\n"; $msg1 .="Graduation Date: " .$_POST["ReceiveDegree"]."\n"; $msg1 .="Advisor: ".$_POST["AdvisorName"]. "\n"; $msg1 .="Advisor Email: ".$_POST["AdvisorEmail"]. "\n"; $msg1 .="Advisor Phone: ".$_POST["ChapterTelephone"]. "\n"; $msg1 .="Agrees to register through MathFest: ".$_POST["Register_through_MathFest"]. "\n"; $msg1 .="T Shirt Size: ".$_POST["TShirtSize"]. "\n"; $msg1 .="Banquet Entree Choice: ".$_POST["MealChoice"]. "\n"; $msg1 .="Agrees to not apply to an MAA Session: ".$_POST["No_MAA_Talk"]. "\n"; $msg1 .="Understands new policy regarding no joint talks: ".$_POST["OneSpeakerPolicy"]. "\n"; $msg1 .="Understands Equipment Policy: ".$_POST["Understanding_Equipment_Policy"]. "\n"; $msg1 .="Understands Time Limitation: ".$_POST["Time_Limitation"]. "\n"; $msg1 .="Presentation is eligible for an award given by the following special interest group: ".$_POST["SpecialCategory"]. "\n"; $msg1 .="Presentation Area: ".$_POST["PresentationTopic"]. "\n"; $msg1 .="Presentation Title: ".$_POST["Title"]. "\n"; $msg1 .="Abbreviated Title: ".$_POST["AbbreviatedTitle"]. "\n"; $msg1 .="Abstract: ".$_POST["Abstract"]. "\n"; $msg1 .="Project Advisor: ".$_POST["PAdvisorName"]. "\n"; $msg1 .="Project Telephone Contact: ".$_POST["PChapterTelephone"]. "\n"; $msg1 .="Agrees to seek low cost transportation: ".$_POST["Low_cost_Transportation"]. "\n"; $msg1 .="Has read the Fine Print: ".$_POST["Read_Fine_Print"]. "\n"; $msg1 .="Agrees to attend student reception: ".$_POST["Reception_Attendance"]. "\n"; $msg1 .="Agrees to attend sessions: ".$_POST["Session_Attendance"]. "\n"; $msg1 .="Agrees to attend banquet: ".$_POST["Banquet_Attendance"]. "\n"; $msg1 .="Agrees to attend Frame Lecture: ".$_POST["Frame_Lecture_Attendance"]. "\n"; $msg1 .="Agrees to submit a participant evaluation form: ".$_POST["Evaluation_Form"]. "\n"; //$recipient= "secretary-treasurer@pme-math.org" ; $recipient = "secretary-treasurer@pme-math.org" ; $subject="PME 2011 MathFest Application"; $mailheaders="From: Paul Fishback \n"; $mailheaders="Reply-To: ".$_POST["email"] ; //Send the mail mail($recipient,$subject,$msg1,$mailheaders); // Insert information into data base // Start of sanitizing function nohack($text) { $text = strip_tags($text); $text = htmlspecialchars($text, ENT_QUOTES); return ($text); //output clean text } function cleanInput($input) { $search = array( '@]*?>.*?@si', // Strip out javascript '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags '@]*?>.*?@siU', // Strip style tags properly '@@' // Strip multi-line comments ); $output = preg_replace($search, '', $input); return $output; } function sanitize($input) { if (is_array($input)) { foreach($input as $var=>$val) { $output[$var] = sanitize($val); } } else { if (get_magic_quotes_gpc()) { $input = stripslashes($input); } $input = cleanInput($input); } return $output; } function safe($input) { $output=nohack($input); $output=sanitize($output); return $output; } $_POST = cleanInput($_POST); // End of sanitizing // Connect to MYSQL server and insert data $mysqli = mysqli_connect("localhost", "mathplac","Superior1#","mathplac_MathFest2011"); if (mysqli_connect_errno()){ printf("Connect failed: %\n",mysqli_connect_error()); exit(); } else { $sql="INSERT INTO StudentInformation (StudentsLastName,StudentsFirstName,StudentEmail,CellNumber, ChapterState,Chapter,UniversityAttended,Initiation_Month,Initiation_Year, Degree,Major,ReceiveDegree,AdvisorName,AdvisorEmail,ChapterTelephone,SummerStreet,SummerCity,SummerState,SummerZipCode, PermStreet,PermCity,PermState,PermZipCode, ApplicationType,USCitizen,TShirtSize,MealChoice, SpecialCategory, PresentationTopic,Title,AbbreviatedTitle, Abstract ) VALUES (' ".$_POST["StudentsLastName"]." ',' ".$_POST["StudentsFirstName"]." ',' ".$_POST["StudentEmail"]." ',' ".$_POST["CellNumber"]." ',' ".$_POST["ChapterState"]." ',' ".$_POST["Chapter"]." ', ' ".$_POST["UniversityAttended"]." ', ' ".$_POST["Initiation_Month"]." ', ' ".$_POST["Initiation_Year"]." ', ' ".$_POST["Degree"]." ', ' ".$_POST["Major"]." ', ' ".$_POST["ReceiveDegree"]." ', ' ".$_POST["AdvisorName"]." ', ' ".$_POST["AdvisorEmail"]." ', ' ".$_POST["ChapterTelephone"]." ', ' ".$_POST["SummerStreet"]." ', ' ".$_POST["SummerCity"]." ', ' ".$_POST["SummerState"]." ', ' ".$_POST["SummerZipCode"]." ', ' ".$_POST["PermStreet"]." ', ' ".$_POST["PermCity"]." ', ' ".$_POST["PermState"]." ', ' ".$_POST["PermZipCode"]." ', ' ".$_POST["ApplicationType"]." ', ' ".$_POST["USCitizen"]." ', ' ".$_POST["TShirtSize"]." ', ' ".$_POST["MealChoice"]." ', ' ".$_POST["SpecialCategory"]." ', ' ".$_POST["PresentationTopic"]." ', ' ".$_POST["Title"]." ', ' ".$_POST["AbbreviatedTitle"]." ', ' ".$_POST["Abstract"]." ') "; $res=mysqli_query($mysqli,$sql); if ($res===TRUE) {echo " ";} else { printf("Registration unsuccessful: %s\n",mysqli_error($mysqli)); } mysqli_close($mysqli); } // End of database insertion ?>