I have a problem and I do not know how to solve it. I and my college colleagues have created a site in PHP in clear localhost, when we host it it displays the following error:
Notice: Use of undefined constant DIR - assumed ' DIR ' in /home/storage/2/3e/eb/noticiasdasgerais/public_html/yteste/loader.php online 19
Notice: Use of undefined constant DIR - assumed ' DIR ' in /home/storage/2/3e/eb/noticiasdasgerais/public_html/yteste/loader.php online 19
Notice: Use of undefined constant DIR - assumed ' DIR ' in /home/storage/2/3e/eb/noticiasdasgerais/public_html/yteste/loader.php online 19
Notice: Use of undefined constant DIR - assumed ' DIR ' in /home/storage/2/3e/eb/noticiasdasgerais/public_html/yteste/loader.php online 19
Could someone give me a hand? We need to deliver this work this week.
Here is the code snippet of line 19
function __autoload($className) {
$r = new RouterController;
//procura primeiro na raiz da app
$classpath = array('Lib', 'helpers', 'Model', 'Controller');
$classFile = $className . ".php";
$loaded = false;
$mod_path = __DIR__ . "/$path" . "/$classFile";
if (is_readable("$mod_path")) {
require "$mod_path";
$loaded = true;
break;
//return false;
}
if (is_readable("$path$classFile")) {
require "$path$classFile";
$loaded = true;
break;
//return false;
}
}
$reserved = array('finfo');
if ($loaded == false && !in_array("$className", $reserved)) {
$baseurl = $r->base();
//@Router::redirect("$baseurl/404.php?return=$baseurl");
exit;
}