* */ 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 ""; } 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() { // TODO: Better 404 error echo "404"; exit; } ?>