www
/
wwwroot
/
magazinmiorita.be
/
admin
➕ New
📤 Upload
✎ Editing:
add_blog.php
← Back
<?php include('../includes/inc.config.php'); include('check_session.php'); if(isset($_POST['add'])){ $title = htmlentities($_POST['title'], ENT_QUOTES); $content = htmlentities($_POST['text'], ENT_QUOTES); $status = $_POST['status']; $filename = $_FILES['image']['name']; $ext = substr($filename, strrpos($filename, '.') + 1); // Thumb Image if (is_uploaded_file($_FILES['image']['tmp_name'])) { $thumb_db = "uploads/blogs/".md5($filename)."_".time().".".$ext; } $add_blog = $database->execute("INSERT INTO `blogs` (`image`, `title`, `text`, `date`, `status`) VALUES ('$thumb_db', '$title', '$content', '".time()."', '$status')"); if($add_blog){ if (is_uploaded_file($_FILES['image']['tmp_name'])) { copy($_FILES['image']['tmp_name'], '../'.$thumb_db); } header('Location: blogs.php?m=ok'); exit; }else{ $smarty->assign("type", 'err'); $smarty->assign("message", 'Blog Article can not be created! Please check and try again.'); } } $smarty->display(END_PATH.'add_blog.tpl'); ?>
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel