0
good afternoon, I am in error when logging into my restricted page...
SCREAM: Error suppression ignored for
( ! ) Fatal error: Call to a member function logar() on a non-object in C:\wamp\www\jauport\loginAdmin.php on line 85
Call Stack
I am making a login page in php using object orientation and I made the method below to log in to my database and retrieve my recorded information
public function logar($email, $senha)
    {
        try{
        $sel_usu = "SELECT * FROM usuario WHERE ema_usujauport = ? AND sen_usujauport = ? ";
        $sel_usu = $this->con->Connect()->prepare($sel_usu);
        $sel_usu->bindValue(1, $this->nome);
        $sel_usu->bindValue(2, $this->email);
        $sel_usu->execute();
        if($sel_usu->rowCount()==1):
           return  true;
        else:
           return false;
        endif;
        }
        catch(PDOException $erro_login){
        'erro'.$erro_login->getMessage();
        }
    }
below i am recovering the value returned by my select
<?php
                if(isset($_POST['logar'])):
                   $login = new Usuario();
                   $email = $_POST['email'];
                   $senha = $_POST['senha'];
                   $login->setEmail($email);
                   $login->setSenha($senha);
                   $login = filter_input(INPUT_POST, "email", FILTER_SANITIZE_MAGIC_QUOTES);
                   $login = filter_input(INPUT_POST, "senha", FILTER_SANITIZE_MAGIC_QUOTES);
                   if($login->logar()):/*aqui ocorre o erro*/
                   header("location: restrito/index.php; ");
                   else:
                   echo 'Erro ao logar';
                   endif;
                endif;
                ?>
In the previous lines you reset login I don’t know why.
– bfavaretto