13 lines
465 B
PHP
13 lines
465 B
PHP
<?php
|
|
require_once __DIR__ . "/../includes/functions.php";
|
|
require_once __DIR__ . "/../includes/auth.php";
|
|
require_admin();
|
|
|
|
$id = isset($_GET["id"]) ? (int)$_GET["id"] : 0;
|
|
if ($id) {
|
|
db()->prepare("DELETE FROM article_tags WHERE article_id=?")->execute([$id]);
|
|
db()->prepare("DELETE FROM comments WHERE article_id=?")->execute([$id]);
|
|
db()->prepare("DELETE FROM articles WHERE id=?")->execute([$id]);
|
|
}
|
|
header("Location: article_list.php?deleted=1"); exit;
|