Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- function base_url(){
- return "http://localhost/PWPB/";
- }
- 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");
- }
- }
- $host = 'localhost';
- $user = 'root';
- $pass = '';
- $db = 'pwpb19';
- $mysqli = mysqli_connect($host, $user, $pass, $db) or die ('Tidak dapat koneksi ke Database');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment