Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('database.php');
- $username=$_POST["kime"];
- $password=$_POST["kloz"];
- $SQL = "SELECT * FROM users WHERE username='$username' AND password='$password'";
- $result = mysqli_query($conn, $SQL);
- $count = mysqli_num_rows($result);
- $row = mysqli_fetch_assoc($result);
- $admin = $row['admin'];
- $ID = $row['ID'];
- if ($count == 1) {
- if($admin == 1) {
- header('Location:admin.php'); // admin si, idi na admin.php
- } else {
- header('Location:user.php'); // user si, idi na user.php
- }
- } else {
- header('Location:index.html'); // login podaci krivi, vrati na login page
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement