init
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
require_once 'auth.php';
|
||||
require_once '../includes/db.php';
|
||||
|
||||
$id = $_GET['id'] ?? 0;
|
||||
|
||||
if ($id > 0) {
|
||||
// 获取应用信息
|
||||
$stmt = $db->prepare("SELECT * FROM apps WHERE id = ?");
|
||||
$stmt->execute([$id]);
|
||||
$app = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($app) {
|
||||
// 删除物理文件
|
||||
$file_path = '../data/apps/' . $app['filename'];
|
||||
if (file_exists($file_path)) {
|
||||
unlink($file_path);
|
||||
}
|
||||
|
||||
// 从数据库删除
|
||||
$stmt = $db->prepare("DELETE FROM apps WHERE id = ?");
|
||||
$stmt->execute([$id]);
|
||||
}
|
||||
}
|
||||
|
||||
header('Location: dashboard.php');
|
||||
exit;
|
||||
Reference in New Issue
Block a user