-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_user_process.php
More file actions
83 lines (74 loc) · 1.9 KB
/
Copy pathadd_user_process.php
File metadata and controls
83 lines (74 loc) · 1.9 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form Submission</title>
<style>
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
background-color: #f4f4f4;
}
.message-container {
background-color: #fff;
border-radius: 5px;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
max-width: 400px;
margin: 20px auto;
}
.message-container img {
width: 100px;
height: auto;
margin-bottom: 20px;
}
.success-message {
color: #4CAF50;
font-weight: bold;
}
.error-message {
color: #f44336;
font-weight: bold;
}
/* Styling tombol kembali */
.back-btn {
background-color: #333;
color: #fff;
padding: 8px 16px;
border: none;
border-radius: 4px;
text-decoration: none;
margin-top: 20px;
display: inline-block;
}
.back-btn:hover {
background-color: #555;
}
</style>
</head>
<body>
<div class="message-container">
<?php
require("connector.php");
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$user_name = $_POST["user_name"];
$email = $_POST["email"];
$password = $_POST["password"];
$role = $_POST["role"];
$db = new DBConnection;
$success = $db->addUser($user_name, $email, $password, $role);
if ($success) {
echo "<img src='aset/agree.png' alt='Success'>";
echo "<p class='success-message'>User data added successfully!</p>";
echo "<a class='back-btn' href='index.php'>Back</a>";
} else {
echo "<p class='error-message'>User added failed!</p>";
}
}
?>
</div>
</body>
</html>