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