The following files exists in this folder. Click to view.
delete_user.php13 lines UTF-8 Unix (LF)
<?php
require_once("check_login.php");
require_once("database_connection.php");
$userId = trim($_GET['userId']); # Hämtar vilket id som skall tas bort
# Gör anropet till databasen
$sql = "DELETE FROM user WHERE userID = :userId;";
$stm = $pdo->prepare($sql);
$stm->execute(array('userId' => $userId));
# Skicka till admin.php med ett meddelande
header("location: admin.php?mess=Användaren med id: $userId är borttagen.");