require_once 'includes/header.php';
if($_POST['status'] == 'Upload')
{
$chk = $con->query("SELECT * FROM blogs where title = '".$_POST['title']."'");
if(!($chk->num_rows))
{
$image = photo_upload('image','blogs');
if($image['status']==1)
{
$con->query("INSERT INTO `blogs` (`id`, `timestamp`, `image`, `title`, `description`) VALUES (NULL, CURRENT_TIMESTAMP, '".$image['file_name']."', '".$_POST['title']."', '".$_POST['description']."')");
echo '';
}
}
}
if($_GET['action']=='del')
{
if(file_exists("../uploads/blogs".$_GET['file']))
unlink("../uploads/blogs".$_GET['file']);
$con->query("DELETE FROM blogs where id = '".$_GET['id']."'");
echo '';
}
?>
Dashboard
Control panel
Add Blog