I'm not able to include pages to my controle_login.php
file as it generates the following errors:
Notice: Use of undefined constant ABSPATH - assumed 'ABSPATH' in C: \ xampp \ htdocs \ Model_MVC \ controlles \ control_login.php on line 2
Warning: require_once (ABSPATH / models / model_login): failed to open stream: No such file or directory in C: \ xampp \ htdocs \ Model_MVC \ controlles \ control_login.php on line 2
Fatal error: require_once (): Failed opening required 'ABSPATH / models / model_login' (include_path = 'C: \ xampp \ php \ PEAR') in C: \ xampp \ htdocs \ Model_MVC \ controls \ control_login.php on line 2
I'll post the codes, because there are weeks that I can not understand what's going on.
Config.php file
Index.phpfile
Filecontrol_login.php(thisfileisinsideafoldercalledcontrols)
<?phprequire_onceABSPATH.'/models/model_login.php';classControladorextendsControle_login{publicfunction__construct(){$obj=newControle_login;}
Filemodel_login.php(thisfileisinsidethemodelsfolder)
<?phprequire_onceABSPATH.'conexao.php';classControle_login{private$con;publicfunction__construct{$con=newConexao();}publicfunctioncontrole_acesso($usuario,$senha){$this->setUsuario($usuario);$this->setSenha($senha);$consulta=$this->con->conectar()->prepare("SELECT COUNT(*) AS total FROM login WHERE usuario=:usuario AND senha=:senha");
$consulta->bindParam(":usuario", $this->usuario);
$consulta->bindParam(":senha", $this->senha);
$consulta->execute();
$linha = $consulta->fetch(PDO::FETCH_ASSOC);
return $linha['total'];
}
}