- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert.php
More file actions
Latest commit
23 lines (17 loc) · 593 Bytes
/
Copy pathinsert.php
File metadata and controls
23 lines (17 loc) · 593 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('konek.php');
$user = $_POST['user'];
$pswd = $_POST['pswd'];
if(strlen($user) < 5 || strlen($pswd) < 5)
echo'User / Password Harus lebih dari 5 Karakter';
else{
$search = mysqli_query($koneksi, 'Select * From user where user="'.$user.'"');
if(mysqli_num_rows($search) > 0)
echo'Nama User Sudah Ada';
else{
$insert = mysqli_query($koneksi, 'Insert Into user (user, password) values ("'.$user.'", "'.$pswd.'")');
if(mysqli_num_rows($insert) == 0)
echo'Gagal Menambah Data';
header('location:index.php');
}
}