One Hat Cyber Team
Your IP :
18.219.68.172
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
/
sd.electronharmony.com
/
Edit File:
deletework.php
<?php session_start(); // Check if user is logged in if (!isset($_SESSION['user_email'])) { header("Location: login.php"); exit(); } // Check if 'id' parameter exists in the URL if (isset($_GET['id'])) { $id = $_GET['id']; // Database connection (update with your own credentials) $servername = "localhost"; $username = "t001"; $password = "ZRTsRb6Ycp585AEC"; $dbname = "t001"; $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // Prepare a delete statement $sql = "DELETE FROM works WHERE id = ?"; $stmt = $conn->prepare($sql); if ($stmt === false) { die("Error preparing statement: " . $conn->error); } // Bind the parameter if (!$stmt->bind_param("i", $id)) { die("Error binding parameters: " . $stmt->error); } // Execute the statement if ($stmt->execute()) { echo "Record deleted successfully"; header("Location: works.php"); } else { echo "Error deleting record: " . $stmt->error; } // Close statement and database connection $stmt->close(); $conn->close(); } else { echo "No ID parameter provided"; } ?>
Simpan