-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeleteuser.php
104 lines (60 loc) · 2.33 KB
/
deleteuser.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!-- <?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once "../hotel/db/db.php";
date_default_timezone_set('Europe/Rome');
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "myhotel";
$conn = new mysqli($servername, $username, $password, $dbname);
if($conn == false){
die("ERROR : could not connect. "
. mysqli_connect_error());
}
//to add Customer
//take all 5 values from the form data
//to delete reservation only id;
$id = $_REQUEST["id"];
$user_name = $_REQUEST["user_name"];
$user_surname = $_REQUEST["user_surname"];
$user_address = $_REQUEST["user_address"];
$user_zipcode = $_REQUEST["user_zipcode"];
$user_phone = $_REQUEST["user_phone"];
//perfor
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- bootstrap link -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<!-- bootstrap link -->
<link rel="stylesheet" href="../hotel/css/styles.css">
<title>Delete User</title>
<div class="container">
<?php
$sql2 = "DELETE FROM myhotel.users WHERE id = '$id'";
$deleteUser = $conn->query($sql2);
if($deleteUser){
echo nl2br("\n User-Id : $id\n Name :$user_name ID: \n "
. " Surname :$user_surname ");
'<div class=" container mt-3 card text-center" style="width: 18rem;">
<img src="https://cdn.pixabay.com/photo/2016/04/15/11/48/hotel-1330850__480.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title"></h5>
<p class="card-text">User deleted successfully!</p>';
}else{
die("record is not deleted it is query error." .mysqli_error($id));
}
//close connection
mysqli_close($conn);
?>
</div>
</head>
<body>
</body>
</html> -->