Hello guys,
I've just written a delete script for my news section.
New, When I push 'delete', The message is removed, so far, so good.
But I would like to display a warning before removing the message.
Something like "Do you really want to remove this newspost"?
How can I do this?
<?php
// includes
include('../conf.php');
include('../functions.php');
// check for record ID
if ((!isset($GET['id']) || trim($GET['id']) == ''))
{
die('No records!');
}
// open database
$connection = mysql_connect($host, $user, $pass) or die ('Unable to connect!');
// select database
mysql_select_db($db) or die ('Unable to select database!');
// generate and execute query
$id = $_GET['id'];
$query = "DELETE FROM news WHERE id = '$id'";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// close database connection
mysql_close($connection);
// print result
echo "delete succesfull.<br/>";
echo "<a href='list.php'>Go to the list</a>.";
?>
Thank you guys!