<?php session_start(); error_reporting(0);  
require_once("../j_conn/url.php");
require_once("../j_conn/dbc.php");
require_once("../j_incs/functions.php");
if(isset($_SESSION['j_admin'])){  
if(isset($_POST['title'])){
$title = RMC2($_POST["title"]);  
$content = RMC2($_POST["content"]); 
$content_sm = RMC2($_POST["content_sm"]); 
if(!empty($content) && !empty($content_sm) && !empty($title)){
	if(strlen($_POST["title"]) <= 100000){
		
	require_once("file1.php");
	$img_cover = $filenames;
 	//insert the record.
	$sql5="INSERT INTO j_blog
	(
	j_title,
	j_content,
	j_content_sm,
	j_img_cover,
 	j_date
	)
	VALUES
	(
 	'".$title."',
 	'".$content."',
 	'".$content_sm."',
	'".$img_cover."',
	'".$CurrentDate."'
	)
	";
	$result5=runSQL($sql5);
	if($result5){
	echo "<div class='alert alert-success'> Content has been added. You can also add more.</div>";	
	//<a href='".$dir."blog/'>View Content</a>
	?>
 	<script>
	$("#form").trigger('reset');
	</script>
	<?php
	}else{ echo "<div class='alert alert-danger'> Could not add content. Try again.</div>";}
	//
 }else{ echo "<div class='alert alert-danger'> Title must be less or equal 100000.</div>";}
 }else{ echo "<div class='alert alert-danger'> Please write your title and content.</div>";}
} //post
} //not in
?>