* */ require_once "src/base.inc.php"; require_once "src/header.inc.php"; // Make sure we have all the needed information if (!isset($_GET['id']) or !is_numeric($_GET['id']) or !isset($_GET['secret'])) { errorNotFound(); } // Get the post. $post = Post::getById($_GET['id']); // Got a post with the right secretid? if (!$post and $post->getSecretId() == $_GET['secret']) { errorNotFound(); } if (isset($_GET['confirmed'])) { // Delete post $post->delete(); echo "

Your post has been removed.

"; echo "

Return to homepage.

"; } else { // Are you sure... echo "

Are you sure you want to remove your posting titled " . $post->getName() ."?

"; echo "

Yes, delete it "; echo "No, do not delete

"; } require_once "src/footer.inc.php"; function errorNotFound() { // Get the 404 page $page = Page::getByUrl('404'); if ($page) { echo $page->getContent(); } else { echo "Error: Page not found."; } require_once "src/footer.inc.php"; exit; } ?>