Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once("includes/config.php");
- require_once("includes/functions.php");
- $username = $_POST["username"];
- $password = $_POST["password"];
- $user = findUser($username);
- if(count($user) > 1){
- exit("You have duplicate username in your table");
- }
- // var_dump($user);
- // echo !password_verify($password, $user[0]["password"]);
- // exit;
- if(count($user) === 0 || !password_verify($password, $user[0]["password"])){
- exit("Username or Password is unvalid");
- }
- $user = $user[0];
- if(loginUser($user)){
- echo "User is logged in";
- }
- else {
- echo "Couldn't log in user";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement