Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "koneksi.php";
- $nama = $_POST['nama'];
- $username = $_POST['username'];
- $password = $_POST['password'];
- $email = $_POST['email'];
- $alamat = $_POST['alamat'];
- $ponsel = $_POST['ponsel'];
- //$data = array($nama,$username,$password,$email,$alamat,$ponsel);
- //var_dump($data);
- // exit();
- if (empty($nama)){
- echo "<script>alert('Nama belum diisi')</script>";
- echo "<meta http-equiv='refresh' content='1 url=daftar.php'>";
- }else
- if (empty($email)){
- echo "<script>alert('Email belum diisi')</script>";
- echo "<meta http-equiv='refresh' content='1 url=daftar.php'>";
- }else
- if(empty($username)){
- echo "<script>alert('Username belum diisi')</script>";
- echo "<meta http-equiv='refresh' content='1 url=daftar.php'>";
- }else
- if (empty($password)){
- echo "<script>alert('Password belum diisi')</script>";
- echo "<meta http-equiv='refresh' content='1 url=daftar.php'>";
- }else{
- $sql="INSERT INTO `alza`.`user` (`id_user`,`nama`, `username`, `password`, `email`, `alamat`, `ponsel`)
- VALUES (NULL,'$nama','$username','$password','$email','$alamat','$ponsel')";
- $daftar = mysql_query($sql);
- if ($daftar){
- echo "<script>alert('Berhasil Mendaftar')</script>";
- echo "<meta http-equiv='refresh' content='1 url=login.php'>";
- }else{
- echo "<script>alert('Gagal Mendaftar')</script>";
- echo "<meta http-equiv='refresh' content='1 url=register.php'>";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement