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

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

$id = $_GET['id'];

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

?>
<legend>Are you sure you want to remove this contact?</legend>
<a href="<?php echo $url; ?>details.php?id=<?php echo $id; ?>" class="btn btn-danger">No</a>
<a href="<?php echo $url; ?>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