Advertisement
Guest User

verify_php11

a guest
Apr 11th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. <?php
  2. include 'connection.php';
  3.  
  4. $fullname = $_POST['fullname'];
  5. $username = $_POST['username'];
  6. $password = $_POST['password'];
  7.  
  8.  
  9.  
  10.  
  11. $result = mysql_num_rows(mysql_query("SELECT * FROM tbl_user WHERE USER_USERNAME='$username'"));
  12. if($result == 1)
  13. {
  14.     echo "<script>
  15. alert ('Nama yang anda masukkan telah digunakan. Sila Tekan OK untuk daftar semula.');
  16. window.location.href='register.php';
  17. </script>";
  18. }
  19. else
  20. {
  21.     mysql_query("INSERT INTO tbl_user (USER_FULLNAME, USER_USERNAME, USER_PASSWORD, LEVEL)
  22. VALUES ('$fullname', '$username', '$password', 'user')");
  23.     echo
  24.     "<script>
  25. alert ('Tahniah! Pendaftaran pengguna telah berjaya.');
  26. window.location.href='index.php';
  27. </script>";
  28. }
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement