My code is part of a virtual store project, and is giving the following error:
Thefollowingisthecodebelow:
<?phpclassLoginextendsBD{private$prefixo='ibicor_';private$tabela='loja_clientes';private$email;private$senha;publicfunctionsetEmail($mail){$this->email=$mail;}privatefunctiongetEmail(){return$this->email;}publicfunctionsetSenha($pass){$this->senha=$pass;}privatefunctiongetSenha(){return$this->senha;}privatefunctionvalidar(){$strSQL="SELECT * FROM '".$this->tabela."' WHERE email_log = ? AND senha_log = ?";
$stmt = self::conn()->prepare($strSQL);
$stmt->execute(array($this->getEmail(), $this->getSenha()));
return ($stmt->rowCount() > 0) ? true : false;
}
public function logar(){
if($this->validar()){
$atualizar = self::conn()->prepare("UPDATE '".$this->tabela."' SET data_log = NOW() WHRE email_log = ? AND senha_log = ?");
$atualizar->execute(array($this->getEmail(), $this->getSenha()));
$_SESSION[$this->prefixo.'emailLog'] = $this->getEmail();
$_SESSION[$this->prefixo.'senhaLog'] = $this->getSenha();
return true;
}else{
return false;
}
}
public function isLogado(){
if(isset($_SESSION[$this->prefixo.'emailLog'], $_SESSION[$this->prefixo.'senhaLog'])){
return true;
}else{
return false;
}
}
public function deslogar(){
if($this->isLogado()){
unset($_SESSION[$this->prefixo.'emailLog']);
unset($_SESSION[$this->prefixo.'senhaLog']);
return true;
}else{
return false;
}
}
}
?>