$common = new common(); $account = new account(); $blog = new blog(); // Check if the user is logged in. if (!$account->isAuthenticated()) { // The user is not logged in so forward them to the login page. header("Location: login.php"); } if ($common->postBack()) { // Delete the selected blog post. $blog->deletePostByTitle(urldecode($_GET['title'])); // Forward the user to the blog management index page. header("Location: /admin/blog/"); } // Get titles and dates for all blog posts. $post = $blog->getPostByTitle(urldecode($_GET['title'])); //////////////// // BEGIN HTML require_once '../includes/header.inc.php'; ?> <h1>Blog Management</h1> <hr /> <h2>Delete Blog Post</h2> <h3><?php echo $post['title']; ?> </h3> <p>Posted <strong><?php echo date_format(date_create($post['date']), "F jS, Y"); ?> </strong> by <strong><?php