init: 我的博客项目
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
<?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;
|
||||
Reference in New Issue
Block a user