Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $conn = mysqli_connect("localhost", "root", "", "database");//ubah yang ni
- session_start();
- if(isset($_SESSION["username"])){
- $user_info = mysqli_fetch_assoc($conn, "SELECT * FROM users WHERE username = '$_SESSION[username]'");
- if($user_info["type"] == "admin"){
- echo "YOU ARE ADMIN.";
- }
- else{
- echo "YOU ARE USER. (Booo)";
- }
- }
- else{
- echo "require login to view this pages. <a href='login.php'>go to login page.</a>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement