3 require 'includes/config.inc.php';
4 require INCLUDES_PATH
.'prepend.php';
6 if (empty($_GET['id'])) {
10 $id = intval($_GET['id']);
12 if (isset($_POST['password']) && PASSWORD
!= sha1($_POST['password'])) {
13 header('Location: index.php');
14 } elseif (isset($_POST['password']) && PASSWORD
== sha1($_POST['password'])) {
17 $dq = $pdo->query('SELECT COUNT(*) FROM news WHERE id='.$pdo->quote($id),PDO
::FETCH_UNIQUE
);
21 $pdo->prepare('DELETE FROM news WHERE id=?');
22 $dq->execute(array(intval($_POST['id'])));
23 unlink('cache/n-'.$id);
27 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
30 <title
>Delete a news
</title
>
33 <form action
="delete.php" method
="post">
34 <input type
="hidden" name
="id" value
="<?php echo $id ?>" />
36 <strong
>Password
:</strong
> <input type
='password' name
='password' size
='20'/><br
/>
37 <input type
="submit" value
="Delete" />