-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprosesregistrasi.php
35 lines (25 loc) · 933 Bytes
/
prosesregistrasi.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
<?php
include "koneksi.php";
$email = $_POST['email'];
$npm = $_POST['npm'];
$nama = $_POST['nama'];
$no = $_POST['no'];
$password = md5($_POST['password']);
$konfirmpassword = $_POST['password'];
$foto = $_FILES['foto']['name'];
$target = "images/".basename($foto);
if (move_uploaded_file($_FILES['foto']['tmp_name'], $target)) {
}
else {
}
$loginuser = mysqli_query($koneksi,"SELECT * FROM user WHERE npm = '$npm' ");
$cekuser = mysqli_num_rows($loginuser);
if($cekuser > 0){
echo '<script language="javascript">alert("Data Sudah Ada !"); document.location="index.html";</script>';
}
else{
$sql = "INSERT INTO user (email,npm,nama,no,password,password_asli,foto) VALUES ('$email','$npm','$nama','$no','$password','$konfirmpassword','$foto')";
$result = mysqli_query($koneksi,$sql);
echo '<script language="javascript">alert("Registrasi Berhasil !"); document.location="index.html";</script>';
}
?>