<?php
	session_start();
	include_once('../../../admin/db/saucerer.php');

	if(isset($_POST['c_submit'])){

	  if ($_POST['c_username']=='') {
		$blog_id = mysqli_real_escape_string($mysqli, $_POST['blog_id']);
		$c_name = mysqli_real_escape_string($mysqli, $_POST['c_name']);
		$c_email = mysqli_real_escape_string($mysqli, $_POST['c_email']);
		$comment = mysqli_real_escape_string($mysqli, $_POST['comment']);

		$sql = "INSERT INTO comments (blog_id, c_name, c_email, comment) 

				VALUES ('$blog_id', '$c_name', '$c_email', '$comment')";

		//use for MySQLi OOP
		if(mysqli_query($mysqli, $sql)){
			echo "<span style='color:#F7931D; font-weight:bold; font-size: 12px;'>Comment successful</span>";
		}
		
		
		else{
			echo "<span style='color:#F7931D; font-weight:bold; font-size: 12px;'>Comment failed!</span>";
		}

	}

}

?>