Here is the code:
<?php
//Connecting to the MySQL database
Connect...
//Naming some variables here.
$id = $_GET['id'];
if($_POST['deny']) {
//We shall not delete the entry, my lord.
$path = "http://admin.romanceanime.com/edit.php";
header("Location: $path");
exit;
} elseif($_POST['confirm']) {
//We shall proceed to delete!
//The MySQl query. Deletes an entry from the database.
$query = "DELETE FROM anime_reviews WHERE ID = '$id'";
//Execute the query.
$result = mysql_query($query) or die(mysql_error());
echo "The entry has been deleted";
// header("Refresh: edit.php");
} else {
?>
<table align="center">
<form action="delete.php" method="post">
<tr><td>Do you really want to delete this entry?</td></tr>
<tr><td><input type="hidden" name="id" value="<?php echo "$id"; ?>" /><input type="submit" name="confirm" value="Yes" /><input type="submit" name="deny" value="No" /></td></tr>
</form>
</table>
<?php
}
?>
I know I'm making these nooby topic's but this forum has improved my skills greatly thanks.
Edited by Dat, 15 September 2007 - 12:27 PM.
