if (count($_POST) > 0 ){
//insert in db
$query = "REPLACE INTO {$schema}.testimonies SET type = \"".mysqli_escape_string($_POST['type'])."\", ";
$query = $query." name = \"".mysqli_escape_string($_POST['name'])."\", ";
$query = $query." testimony = \"".mysqli_escape_string($_POST['testimony'])."\", email= \"".mysqli_escape_string($_POST['email'])."\" , stamp = NOW()";
$res = mysqli_query($db,$query);
if ($res == null){
print "Unable to post testimony:" .mysqli_error($db);
mysqli_close($db);
return;
}
mysqli_close($db);
print "
Thank you for submitting your testimony\n";
print "
Click here to return to list of testimonies\n";
//send email
$message = "Hello,\nThank you for submitting your testimony and sharing with us! We will keep you in our prayers.\n\nGod Bless You\n\nChristian Word Ministries";
$headers = 'From: Christian Word Ministries
' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$mail_sent = @mail( $_POST['email'],"Testimony Received ", $message,$headers);
print "