Location: PHPKode > projects > OpenBlog mini > OpenBlog mini 1.0/delete.php
<?php
	session_start();

	if ($_SESSION['logged_in'] = 'YES') {
	
		include 'config.php';

		echo $html_header;

		// This will delete the selected information from the system:	
		$id_delete = $_POST['id_delete'];
		$id_delete_confirm = $_POST['id_delete_confirm'];

		if ($id_delete_confirm == 'YES') {
			$query_delete = "DELETE FROM " . $mysql_post_table . " WHERE " . $mysql_post_id . " = '" . $id_delete . "'"; 
			mysql_query($query_delete) or die(mysql_error());
			echo "Success: You have deleted the post!";
		}	
		else { echo "Error: You must confirm you want to delete this post. Please go back."; }
			echo $html_footer;
	}
	else { echo "Error: You are not logged-in/allowed to view this page."; }

?>
Return current item: OpenBlog mini