Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <link href="css/app.css" rel="stylesheet">
- <?php
- if(!empty($_POST) && !empty($_POST['username']) && !empty($_POST['password'])){
- require 'db.php';
- require 'functions.php';
- $req = $pdo->prepare('SELECT * FROM users WHERE username = :username OR email = :username');
- $req->execute(['username' => $_POST['username']]);
- $user = $req->fetch();
- if(password_verify($_POST['password'], $user->password)){
- $_SESSION['auth'] = $user;
- header('Location: account.php');
- exit();
- } else {
- $_SESSION['flash']['danger'] = 'Identifiant ou mot de passe incorrect';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement