SHARE
TWEET

Untitled

a guest Jan 25th, 2019 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     include('database.php');
  3.     $username=$_POST["kime"];
  4.     $password=$_POST["kloz"];
  5.    
  6.     $SQL = "SELECT * FROM users WHERE username='$username' AND password='$password'";
  7.     $result = mysqli_query($conn, $SQL);
  8.     $count = mysqli_num_rows($result);
  9.     $row = mysqli_fetch_assoc($result);
  10.     $admin = $row['admin'];
  11.     $ID = $row['ID'];
  12.    
  13.     if ($count == 1) {
  14.         if($admin == 1) {
  15.             header('Location:admin.php'); // admin si, idi na admin.php
  16.     } else {
  17.             header('Location:user.php');    // user si, idi na user.php
  18.         }
  19.     } else {
  20.         header('Location:index.html'); // login podaci krivi, vrati na login page
  21.     }
  22. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top