Advertisement
Guest User

Untitled

a guest
Feb 13th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. session_start();
  2.  
  3. include_once "model.php";
  4.  
  5. if(isset($_POST["login"])){
  6. $username = $_POST["username"];
  7. $password = $_POST["password"];
  8. $realPassword = getPassByName($username);
  9. if($realPassword == null){
  10. echo "<h1>User don't exists, try again <a href='RegisterLogin.html'>here</a></h1>";
  11. }else{
  12. if (password_verify($password, $realPassword)) {
  13. $_SESSION["user"] = getUserByName($username);
  14. header("Location: dashboard.php");
  15. } else {
  16. echo "<h1>Sorry, invalide password</h1>";
  17. }
  18. }
  19. }else{
  20. echo "<h1>Sorry, try again <a href='RegisterLogin.html'>here</a></h1>";
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement