File size: 1.3Kb
<body bgcolor=#D1E7FE>
<title>Admin / Delete News</title>
<? include("configure.php"); ?>
<?
if ($delete == "on") {
$table_name = "ns_news";
$connection = @mysql_connect("$db_server", "$db_name", "$db_password") or die("Couldn't connect.");
$db = @mysql_select_db($db_database, $connection) or die("Couldn't select database.");
$sql = "DELETE FROM $table_name WHERE id = \"$deletenews\"";
$result = @mysql_query($sql,$connection) or die("Couldn't execute query.");
$display = "$title was deleted successfully.";
} else {
$connection = @mysql_connect("$db_server", "$db_name", "$db_password") or die("Couldn't connect.");
$db = @mysql_select_db($db_database, $connection) or die("Couldn't select database.");
$sql = "UPDATE ns_news
set
postby = \"$postby\",
title = \"$title\",
item = \"$item\",
email = \"$email\",
timestamp = \"$timestamp\",
today = \"$today\",
hldate = \"$hldate\"
where id = \"$deletenews\"
";
$result = @mysql_query($sql, $connection) or die("Couldn't execute query.");
$display = "
<p>
<b>Posted By</b>
<br>$postby
</p>
<p>
<b>Title</b>
<br>$title
</p>
<p>
<b>News Item</b>
<br>$item
</p>
";
}
?>
<font size=4>
<p>
<? echo $display; ?>
</p>
<p>
<a href="admin.php">Admin Center</a>
</p>
</font>