Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- function base_url() {
- return "http://localhost/pwpb18";
- }
- function flash($tipe, $pesan = ''){
- if (empty($pesan)) {
- $pesan = @$_SESSION[$tipe];
- unset($_SESSION[$tipe]);
- return $pesan;
- }
- else {
- $_SESSION[$tipe] = $pesan;
- }
- }
- function cekLogin() {
- $username = @$_SESSION['username'];
- $level = @$_SESSION['level'];
- if (empty($username) AND empty($level)) {
- header("location:login.php");
- }
- }
- function sudahLogin() {
- $username = @$_SESSION['username'];
- $level = @$_SESSION['level'];
- if (!empty($username) AND !empty($level)) {
- header("location:index.php");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement