include 'db_connect.php'; if(isset($_POST['submit'])){ $_POST['first'] = mysql_real_escape_string($_POST['first']); $_POST['last'] = mysql_real_escape_string($_POST['last']); $_POST['gender'] = mysql_real_escape_string($_POST['gender']); $_POST['city'] = mysql_real_escape_string($_POST['city']); $_POST['test'] = mysql_real_escape_string($_POST['test']); $query = "insert into `preTestimonials` SET first = '".$_POST['first']."', last = '".$_POST['last']."', gender = '".$_POST['gender']."', city = '".$_POST['city']."', testimonial = '".$_POST['test']."', short = '".$_POST['test']."'"; $result = mysql_query($query); if($result){ $success = "Thank you for your Submission. We will review your testimonial and if it is approved it will shortly be added to the website. To EXIT click the 'X' in the top right corner."; }else{ $error = "Uh oh! Looks like your submission failed!! Fill in the fields and try again. If the problem continues send your testimonial through the form found on the contact page."; } } ?>