Advertisement
Iyanyan

bug bypass admin

Oct 23rd, 2019
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2.   $message = "";
  3.   if(isset($_POST['submit'])){
  4.      $username= ($_POST[username]);
  5.      $password = md5($_POST['password']);
  6.     $query = "SELECT * FROM admin WHERE username = '$username' and password = '$password' and usertype = '1'";
  7.      $query_result = mysqli_query($con, $query);
  8.      if(mysqli_num_rows($query_result)){
  9.         $row = mysqli_fetch_assoc($query_result);
  10.         $_SESSION['admin_id'] = $row['id'];
  11.         $_SESSION['username'] = $row['username'];
  12.         header("location: index.php");
  13.      }else{
  14.        $message = "Username and password is not matched.";
  15.      }
  16.   }
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement