SHARE
TWEET

Untitled

a guest Jun 5th, 2017 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. session_start();
  3.  
  4. if ($_SERVER['REQUEST_METHOD'] == 'GET')
  5. {
  6.     session_destroy();
  7.     header("location: ../public/resultateninvoer.php");
  8. }
  9.  
  10. require_once("database.php");
  11. $username = $_POST["username"];
  12. $password = $_POST["password"];
  13.  
  14. $sql = "SELECT * FROM `tbl_users`
  15. WHERE `username` = '$username';";
  16. $user = $database->query($sql)->fetch(PDO::FETCH_ASSOC);
  17.  
  18. if (password_verify($password, $user["password"]))
  19. {
  20.     $_SESSION["logged"] = true;
  21.     $_SESSION["user"] = $username;
  22.  
  23.     header("location: ../public/todolist.php");
  24. }
  25. else
  26. {
  27.     $_SESSION["logged"] = false;
  28.  
  29.     header("location: ../public/resultateninvoer.php");
  30. }
  31. ?>
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