<?php
session_start();

if ($_SESSION["denglu"] != 1)
{
	echo "<h3>you have not logged in</h3>";
	echo "If you are an administrator, <a href=../login.php>login here</a><br>";
	echo "If you are not administrator, <a href=../index.htm>visit our website</a>";
	exit;
}

include "../conn.php";

$id = $_GET["id"];

$query = "delete from news where id=$id";

if ($_SESSION["denglu"] == 1)
{
	mysql_query($query);
}
else
{
	echo "<p><center><table width=80%>You must login as administrator to delete news</table></center>";
}

header("location: newslisting.php");
?>