-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathadd-user.php
More file actions
23 lines (15 loc) · 733 Bytes
/
add-user.php
File metadata and controls
23 lines (15 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
include("includes/db_conn.php");
$fullname = mysqli_real_escape_string($db, $_POST['fullname']);
$role = mysqli_real_escape_string($db, $_POST['role']);
$username = mysqli_real_escape_string($db, $_POST['username']);
$password = mysqli_real_escape_string($db, $_POST['password']);
$status = mysqli_real_escape_string($db, $_POST['status']);
$insert_user = "INSERT INTO admin_tbl(fullname, role, admin_username, admin_password, status)VALUES('$fullname', '$role', '$username', '$password', '$status')";
$run_user = mysqli_query($db, $insert_user);
if($run_user)
{
echo "<script>alert('New Admin added successfully!')</script>";
echo "<script>document.location='manage-user.php'</script>";
}
?>