<?php

defined('_MAILING') or die('Restricted access');

if (DEMO_MODE) {
    header("Location: index.php?manage=blacklist&action=list");
    exit();
}

$app->checkToken();

$id = (int)$_POST['id'];

try {
    $sql = " DELETE FROM ".PREF."_blacklist WHERE id = :id ";
    $stmt = $db->prepare($sql);              
    $stmt->bindParam(':id', $id, PDO::PARAM_INT);
    $stmt->execute();
    
    header("Location: index.php?manage=blacklist&action=list");
    
} catch (Exception $e) {
    echo 'ERROR: ',  $e->getMessage(), "\n";
}
