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;