Good afternoon, I'm having trouble 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'm doing a login page in php using object orientation and I've done the method below to login to my bank and retrieve my saved 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'm retrieving 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;
?>