Created
January 15, 2018 00:53
-
-
Save wichaksono/85a5f19bc55b4732797f3ff72bc1b838 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
/** | |
* Jika Tidak login atau sudah login tapi bukan sebagai admin | |
* maka akan dibawa kembali kehalaman login atau menuju halaman yang seharusnya. | |
*/ | |
if ( !isset($_SESSION['user_login']) || | |
( isset($_SESSION['user_login']) && $_SESSION['user_login'] != 'admin' ) ) { | |
header('location:./../login.php'); | |
exit(); | |
} | |
?> | |
<h2>Hallo Admin <?=$_SESSION['nama'];?> Apakabar ?</h2> | |
<a href="./../logout.php">Logout</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment