Advertisement
Guest User

Untitled

a guest
Apr 11th, 2016
94
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. session_start();
  3. include("dbcon.php");
  4. error_reporting(E_ALL & ~E_NOTICE);
  5.  
  6. $username = $_POST["username"];
  7. $password = md5($_POST["password"]);
  8.  
  9. $abfrage = mysqli_query($db, "SELECT * FROM login WHERE username LIKE => = '$username' LIMIT 1");
  10. $row = mysqli_fetch_object($abfrage);
  11.  
  12. $_SESSION['username'] = $username;
  13. if($row->password == $password && $row->rechte == "admin")
  14. {
  15. header("Location: index.php");
  16. }
  17. elseif ($row->password == $password && $row->rechte != "admin")
  18. {
  19. header("Location: index.php");
  20. }
  21. else
  22. {
  23. header("Location: login.html");
  24. }
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement