Use of undefined constant
Good was with the same problem of this question, gave an answer to use define('ROOT_PATH', dirname(__FILE__));
, (my problem without using this solution) but in mine it does not work.
the following error appears:
Warning: Use of undefined constant directory-assumed 'Directory' (this will throw an Error in a future version of PHP) in C:\wamp64\www\php_pdo\view\sign-in.php online 27
Index.php:
<php
define('DIRETORIO', dirname(__DIR__));
...
Sign-in.php:
<?php
if($_POST){
$usuario = filter_input(INPUT_POST, 'usuario', FILTER_SANITIZE_STRING);
$senha = filter_input(INPUT_POST, 'senha', FILTER_SANITIZE_STRING);
require_once DIRETORIO . '/controller/logincontroller.php'; // linha 27
LoginController::logar($usuario, $senha);
}
I tried to do what this answer suggests, but it did the same.
Sign-in.php
<?php
if($_POST){
$usuario = filter_input(INPUT_POST, 'usuario', FILTER_SANITIZE_STRING);
$senha = filter_input(INPUT_POST, 'senha', FILTER_SANITIZE_STRING);
require_once '../index.php';
require_once DIRETORIO . '/controller/logincontroller.php'; // linha 27
LoginController::logar($usuario, $senha);
}
0