Advertisement
Ugly_Boy

Untitled

Jan 12th, 2020
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.09 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en" dir="ltr">
  3.   <head>
  4.     <meta charset="utf-8">
  5.     <title>Vadlan Ramdani XIRPL3</title>
  6.   </head>
  7.   <body>
  8.     <?php
  9.         session_start();
  10.  
  11.         function base_url() {
  12.             return "http://localhost/pwpb19";
  13.         }
  14.  
  15.         function flash($tipe, $pesan = '') {
  16.             if (empty($pesan)) {
  17.                 $pesan = @$_SESSION[$tipe];
  18.                 unset($_SESSION[$tipe]);
  19.                 return $pesan;
  20.             } else {
  21.                 $_SESSION[$tipe] = $pesan;
  22.             }
  23.         }
  24.  
  25.         function cekLogin() {
  26.             $Username = @$_SESSION['Username'];
  27.             $Level    = @$_SESSION['Level'];
  28.  
  29.             if (empty($Username) AND empty($Level)) {
  30.                 header("location: login.php");
  31.             }
  32.         }
  33.  
  34.         function sudahLogin() {
  35.             $Username = @$_SESSION['Username'];
  36.             $Level    = @$_SESSION['Level'];
  37.  
  38.             if (empty($Username) AND !empty($Level)) {
  39.                 header("location: index.php");
  40.             }
  41.         }
  42.     ?>
  43.   </body>
  44. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement