forked from marwenhlaoui/PhpbasicE-commerce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete_user.php
24 lines (22 loc) · 1.16 KB
/
delete_user.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
include('config.php');
if (isset($_SESSION['user'])) {
if ($_SESSION['user']['ROLE'] == "1") {
if (isset($_GET['id'])) {
$iduser= $_GET['id'];
$data = "SELECT * FROM `abonne` WHERE `ID` LIKE '".$iduser."'";
$datauser = $base->query($data)->fetch_array(MYSQLI_ASSOC);
if ((!empty($datauser))&&($datauser['ROLE'] != "1")) {
$base->query("DELETE FROM abonne WHERE ID=".$iduser."");
}
header('Location: listusers.php');
}else{
header('Location: listusers.php');
}
}else{
header('Location:index.php');
}
}else{
header('Location:login.php');
}
?>