I have a link going to 'deletepost.php' from my admin page. There is a link such as this:
example.com/deletepost.php?postID=8
However, when I click that link, I always get my 'Deletion Failed' message. Any ideas?
Deletepost.php:
PHP Code:<?php
include 'top.php';
$postID = $_GET['postID'];
$postID = intval($_GET['postid']);
$delete = "DELETE * FROM posttbl WHERE postID=$postID";
$dbcnx = mysql_connect("localhost", "****", "****");
mysql_select_db("****");
if(!isset($_SESSION['authorized']))
{
header('Location: login.php');
}
$delete = mysql_query($delete);
if($delete)
{
header('Location: index.php');
}
else
{
exit('Deletion failed');
}
echo mysql_error();
?>




.


Bookmarks