Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "koneksi.php";
- $username = $_POST['username'];
- $password = $_POST['password'];
- if (empty($username)){
- echo "<script>alert('Username belum diisi')</script>";
- echo "<meta http-equiv='refresh' content='1 url=login.php'>";
- }else if (empty($password)){
- echo "<script>alert('Password belum diisi')</script>";
- echo "<meta http-equiv='refresh' content='1 url=login.php'>";
- }else{
- session_start();
- $azabu = mysql_query("select * from users where username='$username' and password='$password'");
- if $select = mysql_fetch_array(mysql_query("select * from users where username='$username' and password='$password'"));
- $_SESSION['username'] = $username;
- if($select["level"] == 1){
- header('location:halaman_admin.php');
- }else if($select["level"] == 2){
- header('location:halaman_user.php');
- }else{
- header('location:halaman_login.php');
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement