Skip to content

Instantly share code, notes, and snippets.

@wichaksono
Created January 15, 2018 00:54
Show Gist options
  • Save wichaksono/dabb7de798776cbda522b11f53a03dad to your computer and use it in GitHub Desktop.
Save wichaksono/dabb7de798776cbda522b11f53a03dad to your computer and use it in GitHub Desktop.
<?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'] != 'member' ) ) {
header('location:./../login.php');
exit();
}
?>
<h2>Hallo Member <?=$_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