Advertisement
Guest User

asdqqq

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