-
Notifications
You must be signed in to change notification settings - Fork 1
/
tambah_user.php
72 lines (69 loc) · 1.74 KB
/
tambah_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
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
<!DOCTYPE html>
<html>
<head>
<title>pemograman3.com</title>
</head>
<?php
//koneksi database
include 'koneksi.php';
//menangkap data yang di kirim dari form
if (!empty($_POST['save'])){
$Nama = $_POST['Nama'];
$Password = $_POST['Password'];
$level = $_POST['level'];
$status = $_POST['status'];
//menginput data ke database
$a=mysqli_query($koneksi,"insert into user values('','$Nama','$Password','$level','$status')");
if($a){
//mengalihkan halaman kembali
header("location:tambah_user.php");
}else{
echo mysqli_error();
}
}
?>
<body>
<h2>pemograman3 2023</h2>
<br/>
<a href="http://localhost/keuangan/tampil_user.php">KEMBALI</a>
<br/>
<br/>
<h3>TAMBAH DATA USER</h3>
<form method="POST">
<table>
<tr>
<td>Nama</td>
<td><input type="text" name="Nama"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="text" name="Password"></td>
</tr>
<tr>
<td>level</td>
<td><select name="level">
<option value="">-----pilih</option>
<option value="1">Admin</option>
<option value="2">Staff</option>
<option value="3">Spv</option>
<option value="4">Mgr</option>
</select>
</td>
</tr>
<tr>
<td>status</td>
<td><select name="status">
<option value="">-----pilih</option>
<option value="1">Aktif</option>
<option value="0">tdk aktif</option>
</select>
</td>
</tr>
<tr>
<td><td>
<td><input type="submit" name="save"></td>
</tr>
</table>
</form>
</body>
</html>