PHP CMS blog adding images with post
Hi, so I have made a CMS blog just barely but it looks pretty nice one thing that is stopping me minus making it secure is finding out how to include images in my blog posts I don't know how to get an image to upload to the database along with the article post so that it wouold share the same id to be retrived and displayed with the post if (isset($_SESSION['logged_in'])){ //display admin page if (isset($_POST['title'], $_POST['content'],$_POST['description'],$_POST['user'],$_POST['category'])){ $title = $_POST['title']; $content = nl2br($_POST['content']); $description = nl2br($_POST['description']); $user = $_POST['user']; $category = $_POST['category']; if(empty($title) or empty($content) or empty($description) or empty($user)){ $error = 'All fields must contain content'; }else{ $query = $pdo->prepare('INSERT INTO articles (article_title, article_content, article_description, article_user, article_category, article_timestamp) VALUES (?,?,?,?,?,?)'); $query->bindValue(1, $title); $query->bindValue(2, $content); $query->bindValue(3, $description); $query->bindValue(4, $user); $query->bindValue(5, $category); $query->bindValue(6, time()); $query->execute(); $posted = 'Posted Congratulations on another finished article!'; } } ?> <form action="add.php" method="post" autocomplete="off"> <input type="text" name="title" placeholder="title" /> <br/><br /> <textarea rows="15"cols="70" placeholder="content" name="content"></textarea> <br /> <br /> <textarea rows="15"cols="70" placeholder="description 155chars" name="description"></textarea> <br /> <br /> <select name="user"> <option value="Ally">Ally</option> <option value="Ed">Ed</option> </select> <select name="category"> <option value="family">Family</option> <option value="business">Business</option> <option value="friends">Friends</option> </select> <input type="submit" value="Add Article" /> <