Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include "../../settings/connection.php";
- if(isset($_SESSION["admin"])){
- header("Location: ../index.php");
- }
- if(isset($_POST)&&$_POST["username"]&&$_POST["password"]){
- $username=$_POST["username"];
- $password=$_POST["password"];
- $perintah="SELECT * FROM karyawan WHERE UserName='".$username."' AND Password='".$password."'";
- $ambil=mysql_query($perintah,$server_connect);
- if($ambil){if(mysql_num_rows($ambil)>=1){
- $data=mysql_fetch_array($ambil);
- $_SESSION["admin"]=$data["NIK"];
- $_SESSION["level"]=$data["Level"];
- header("Location: ../index.php?login_success=true");
- }else{header("Location: ../login.php?login_fail=true");}}else{header("Location: ../login.php?login_fail=true");}
- }else{header("Location: ../login.php?login_fail=true");}
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement