Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'connection.php';
- $fullname = $_POST['fullname'];
- $username = $_POST['username'];
- $password = $_POST['password'];
- $result = mysql_num_rows(mysql_query("SELECT * FROM tbl_user WHERE USER_USERNAME='$username'"));
- if($result == 1)
- {
- echo "<script>
- alert ('Nama yang anda masukkan telah digunakan. Sila Tekan OK untuk daftar semula.');
- window.location.href='register.php';
- </script>";
- }
- else
- {
- mysql_query("INSERT INTO tbl_user (USER_FULLNAME, USER_USERNAME, USER_PASSWORD, LEVEL)
- VALUES ('$fullname', '$username', '$password', 'user')");
- echo
- "<script>
- alert ('Tahniah! Pendaftaran pengguna telah berjaya.');
- window.location.href='index.php';
- </script>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement