include("top.php"); $title="Testimonials - $site_mtitle"; $desc=$site_mdesc; $keyword=$site_mkeyword; sendHeaders($title,$desc,$keyword); include("header.php"); $error=0; $sent="N"; $err_message=""; $date=date('Y-m-d',time()); //error_reporting(E_ALL); if (!empty($_POST)){ $img = new Securimage(); $valid = $img->check($_POST['code']); $fname=$_POST['fname']; $femail=$_POST['femail']; $fheading=$_POST['fheading']; $fcomment=escapeText($_POST['fcomment']); $date=date("Y-m-d",time()); //start of validation $result=validateForm($fname,"alphanumeric","Y","",""); if($result[0]>0){$error=$error+1;$err_message.='
Your name is '.$result[1].'
';} if ($error<1){ $result=validateForm($femail,"email","Y","",""); if($result[0]>0){$error=$error+1;$err_message.='Your email address is '.$result[1].'.
';} } if ($error<1){ $result=validateForm($fheading,"alphanumeric","Y","",""); if($result[0]>0){ $error=$error+1; $err_message.='Heading is '.$result[1].'.
'; } } if ($error<1 && $fcomment==""){$error=$error+1;$err_message.='Comment is required.
';} if ($error<1 && $valid!=true){ $error=$error+1; $err_message.='The characters in the image didn\'t match, please try again
'; } //end of validation if($error<1){ $query = "INSERT INTO comments VALUES('','$fname','$fheading','$fcomment','$femail','n','$date','Online','','');"; $mysql9 = mysql_query($query) or die("SELECT Error: ".mysql_error()); $cmt_id=mysql_insert_id(); $headers = "From: $fname<$femail>\r\n Reply-To: $femail\r\n" . "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1"; $subject = "Website Testimonial: ".$fheading; $to = $site_email; $message = ""; $message .= "Click here to login to your admin panel to approve or delete this comment.
"; $message .= "Thank you!
Your testimonial has been sent, we will monitor it as soon as possible.
Mail send failure - message not sent, please try again later, sorry for any inconvenience
"; } } }?>Comments coming soon ...
}?>