Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- session_start();
- include_once "model.php";
- if(isset($_POST["login"])){
- $username = $_POST["username"];
- $password = $_POST["password"];
- $realPassword = getPassByName($username);
- if($realPassword == null){
- echo "<h1>User don't exists, try again <a href='RegisterLogin.html'>here</a></h1>";
- }else{
- if (password_verify($password, $realPassword)) {
- $_SESSION["user"] = getUserByName($username);
- header("Location: dashboard.php");
- } else {
- echo "<h1>Sorry, invalide password</h1>";
- }
- }
- }else{
- echo "<h1>Sorry, try again <a href='RegisterLogin.html'>here</a></h1>";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement