-2
My code is part of a virtual store project, and is giving the following error:
Follow the code below:
<?php class Login extends BD{
private $prefixo = 'ibicor_';
private $tabela = 'loja_clientes';
private $email;
private $senha;
public function setEmail($mail){
$this->email = $mail;
}
private function getEmail(){
return $this->email;
}
public function setSenha($pass){
$this->senha = $pass;
}
private function getSenha(){
return $this->senha;
}
private function validar(){
$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;
}
}
}
?>
And be careful with the prints that have personal information. Your email is visible in the error image, just your password also appeared there.
– Isac
It’s all test email
– Matheus Viotto
Place the error as text, not image, because it makes it difficult to view.
– Renato Junior