-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocAddMember.php
More file actions
35 lines (26 loc) · 925 Bytes
/
procAddMember.php
File metadata and controls
35 lines (26 loc) · 925 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
34
35
<?php
include("config.php");
if (isset($_POST['daftar'])) {
date_default_timezone_set(ASIA/JAKARTA);
$nama = $_POST['nama'];
$jenisKelamin = $_POST['jenisKelamin'];
$alamat = $_POST['alamat'];
$username = $_POST['username'];
$password = $_POST['passwd'];
$level = $_POST['lvl'];
$tglSimpan = date("y-m-d");
$sql = "INSERT INTO profile(nama, jenisKelamin, alamat, tglSimpan, username, passwd, lvl)
VALUE ('$nama','$jenisKelamin','$alamat','$tglSimpan','$username','$password','$level')";
$query = mysqli_query($db, $sql);
if( $query ) {
// kalau berhasil alihkan ke halaman index.php dengan status=sukses
header('Location: index.php?status=sukses');
} else {
// kalau gagal alihkan ke halaman indek.php dengan status=gagal
header('Location: index.php?status=gagal');
}
} else {
# code...
die("Akses dilarang...");
}
?>