%PDF- %PDF-
Direktori : /proc/thread-self/root/home/medipszd/www/admin/ |
Current File : //proc/thread-self/root/home/medipszd/www/admin/users_delete.php |
<?php include 'includes/session.php'; if(isset($_POST['delete'])){ $id = $_POST['id']; $conn = $pdo->open(); try{ $stmt = $conn->prepare("DELETE FROM users WHERE id=:id"); $stmt->execute(['id'=>$id]); $_SESSION['success'] = 'User deleted successfully'; } catch(PDOException $e){ $_SESSION['error'] = $e->getMessage(); } $pdo->close(); } else{ $_SESSION['error'] = 'Select user to delete first'; } header('location: users.php'); ?>