Iyanyan

ssdsds

Oct 23rd, 2019
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2. $message = "";
  3. if(isset($_POST['submit'])){
  4. $username = addslashes(trim($_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. ?>
Add Comment
Please, Sign In to add comment