Site hosted by Angelfire.com: Build your free website today!

Check In

Check In

QUESTION ANSWER
Your Email Address
Your Account Name
Today Date
Program you are going to use
Other Programs?
Qik! What others folder do you want me to add?
Check if we may contact you. (Important)
Survey Submitted

Submitted Information

email - " .$email; echo "
sex - " .$sex; echo "
yearsstudent - " .$yearsstudent; echo "
dateofbirth - " .$dateofbirth; echo "
optout - " .$optout; echo "
comments - " .$comments; echo "
submit - " .$submit; // Depending on which submit button was pressed, send an email or insert into database if ($submit == "Submit Form To Database") { // Connect to mysql server $link = mysql_connect("octave.mit.edu:3306", "webdb", "folklore") or die ("Could not Connect to database!"); // Select database to use mysql_select_db("webdb") or die ("Could not use database somacon!"); // Create the query $query = "INSERT INTO survey (email, sex, yearsstudent, dateofbirth, optout, comments, ipaddr) VALUES ('$email', '$sex','$yearsstudent','$dateofbirth','$optout','$comments','$REMOTE_ADDR')"; // Execute the query on the database $result = mysql_query($query) or die ("Invalid query"); echo "

Form data successfully inserted into database."; } elseif ( $submit == "Submit Form To Email" ) { // Build Email Message from Form values $email_message = $email."\n".$account."\n".$date."\n".$program."\n".$others."\n".$othersfolder."\n".$submit; // Get the date for stamping the email $strdate = date("D, d M Y H:i:s",time()); // Send the email $retval = mail("tanjiankai@hotmail.com", "Survey Submission", $email_message, "From: tanjiankai@hotmail.com\nReply-To: tanjiankai@hotmail.com\nDate: ".$strdate."\nX-Mailer: PHP/"); // Check if the email sending was successful if( $retval ) { echo "

Form data successfully emailed."; } else { echo "

Error sending form data by email! Please contact youremail@yourdomain.com."; } } print "

Go back to the Outline."; ?>