Advertisement
ktmmmm

Untitled

Jul 2nd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <link href="css/app.css" rel="stylesheet">
  2. <?php
  3. if(!empty($_POST) && !empty($_POST['username']) && !empty($_POST['password'])){
  4. require 'db.php';
  5. require 'functions.php';
  6. $req = $pdo->prepare('SELECT * FROM users WHERE username = :username OR email = :username');
  7. $req->execute(['username' => $_POST['username']]);
  8. $user = $req->fetch();
  9. if(password_verify($_POST['password'], $user->password)){
  10. $_SESSION['auth'] = $user;
  11. header('Location: account.php');
  12. exit();
  13. } else {
  14. $_SESSION['flash']['danger'] = 'Identifiant ou mot de passe incorrect';
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement