session_start(); // Load the require PHP classes. require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "common.class.php"; require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "account.class.php"; require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "blog.class.php"; $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']; ?>