Location: PHPKode > projects > Simple Comments > comments/admin/deletecomment.php
<? require("header.php"); ?>
<?
require_once( '../config.php' );
$id=$_GET['id'];
?>
<form method="post">
<p align="center">
Are you sure you want to delete this comment?
<input type="hidden" name="confirm" value="1">
<br>
<input type="Submit" value="Delete">
</form>
<?
$confirm=$_POST['confirm'];

if ($confirm==1) {

mysql_connect($dbaddress,$dbuser,$dbpass);
@mysql_select_db($dbname) or die( "Unable to select database");
$query=" DELETE FROM comments WHERE id='$id'";
mysql_query($query);
echo "<br>Comment Deleted.<br>";
mysql_close();
?>
<br><br>
<a href="javascript: history.go(-2)">Back</a><br>
<?
} else {

?>
<br><br>
<a href="javascript: history.go(-1)">Back</a><br>
<?
}
Return current item: Simple Comments