Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include ('koneksi.php');
- $username = $_POST['username'];
- $password = $_POST['password'];
- $ambil = mysql_query("SELECT * FROM user WHERE username='$username' AND password='$password'");
- $ada = mysql_num_rows($ambil);
- $data = mysql_fetch_array($ada);
- if ($username == '' or $password =='') {
- ?>
- <script>
- alert(username dan passwor tidak boleh kosong);
- window.location.href'index.php';
- </script
- <?php
- }
- else if ($ada > 0){
- $_SESSION['username'] = $data['username'];
- ?>
- <script>
- window.location.href='menu.php';
- </script>
- <?php
- }
- else {
- ?>
- <script>
- alert('Maaf, username dan Password anda salah !!!');
- window.location.href='index.php';
- </script>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement