Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function Login($email, $password)
- {
- $stmt = $this->pdo->prepare("SELECT user_id from users where email = :email AND password = :password");
- $stmt->bindParam(":email", $email, PDO::PARAM_STR);
- $stmt->bindParam(":password", $password, PDO::PARAM_STR);
- $stmt->execute();
- $user = $stmt->fetch(PDO::FETCH_OBJ);
- $count = $stmt->rowCount();
- if($count >0){
- $_SESSION['user_id'] = $user->user_id;
- header('Location:home.php');
- }else{
- return false;
- }
- }
Add Comment
Please, Sign In to add comment