-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput-user.php
More file actions
33 lines (30 loc) · 934 Bytes
/
input-user.php
File metadata and controls
33 lines (30 loc) · 934 Bytes
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
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>Input User || fhuphmedan.org</title>
</head>
<body>
<?php
require_once "db.php";
if(isset($_POST['name']) && isset($_POST['username']) && isset($_POST['password']) && isset($_POST['category'])){
$name = $_POST['name'];
$username = $_POST['username'];
$password = $_POST['password'];
$category = $_POST['category'];
$conn = konek_db();
$query = $conn->prepare("insert into user(name,username,password,category) value(?,?,?,?)");
$query->bind_param("ssss",$name,$username,$password,$category);
$result = $query->execute();
if(!$result){
echo "<script type='text/javascript'>alert('Data Tidak Lengkap');window.location.href = 'admin.php';</script>";
} else{
echo "<script type='text/javascript'>alert('Input User Berhasil');window.location.href = 'admin.php';</script>";
}
} else
die("Koneksi gagal");
?>
</body>
</html>