-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathproses_daftar.php
29 lines (23 loc) · 935 Bytes
/
proses_daftar.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
<?php
include 'koneksi.php';
$password = md5($_POST['password']);
$sql = mysql_query("SELECT * FROM `akun` WHERE username = '$_POST[username]' ") or die(mysql_error());
if(mysql_num_rows($sql) == 0)
{
$input_akun="INSERT INTO `akun` (`username`, `password`, `level`) VALUES ('$_POST[username]', '$password', '3');";
$input_murid="INSERT INTO `murid` (`nisn`, `nama_murid`, `kota`, `jenkel`, `agama`, `jurusan`, `kelas`) VALUES ('$_POST[Nisn]', '$_POST[Nama_Murid]', '$_POST[Kota]', '$_POST[Jenis_Kelamin]', '$_POST[Agama]', '$_POST[Jurusan]', '$_POST[Kelas]');";
echo (" <SCRIPT LANGUAGE='JavaScript'>
window.alert('Berhasil Registrasi')
window.location.href='index.php';
</SCRIPT>");
(mysql_query($input_akun));
(mysql_query($input_murid));
}
else
{
echo (" <SCRIPT LANGUAGE='JavaScript'>
window.alert('Registrasi Gagal Username sudah Terdaftar')
window.location.href='index.php';
</SCRIPT>");
}
?>