Location: PHPKode > scripts > PHP Address book > php-address-book_v_1.02_eng/user_delete.php
<?php 
include_once 'includes/header.inc.php'; 

if(!$session->getRole() == 2){
    header("location: login.php");
}

$id = $_GET['id'];

if($_GET['action'] == "confirmed"){
    $query = $mysqli->prepare("DELETE FROM `cal_users` WHERE `id` = ?");
    $query->bind_param(i, $id);
    $query->execute();
    $query->store_result();
    
    header("location: user_management.php");
}

?>
<legend>Are you sure you want to remove this user?</legend>
<a href="<?php echo $url; ?>user_edit.php?id=<?php echo $id; ?>" class="btn btn-danger">No</a>
<a href="<?php echo $url; ?>user_delete.php?id=<?php echo $id; ?>&action=confirmed" class="btn btn-success">Yes</a>

<?php include_once 'includes/footer.inc.php'; ?>
Return current item: PHP Address book