Server IP : 103.53.40.154 / Your IP : 18.116.81.255 Web Server : Apache System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : ppcad7no ( 715) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home2/ppcad7no/servostabilizermanufacturers.in/../goldensafe.in/admin/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php include_once('config.php'); $id = intval($_GET['id']); // Fetch existing images $existing_images_query = "SELECT `img1`, `img2` FROM `tbl_services` WHERE sr_id = $id"; $existing_images_result = $db->query($existing_images_query); $existing_images_row = $existing_images_result->fetch_assoc(); $image_fields = ['img1', 'img2']; foreach ($image_fields as $image_field) { if (!empty($existing_images_row[$image_field])) { $file_path = 'images/' . $existing_images_row[$image_field]; if (file_exists($file_path)) { unlink($file_path); } } } // Delete the record from the database $causeQuery = "DELETE FROM `tbl_services` WHERE sr_id = $id"; $causeResult = mysqli_query($db, $causeQuery); if ($causeResult) { header('location: manage-property.php'); exit; } else { echo "Failed to delete the record from tbl_services."; } ?>