Load classes
Hy i have problem with loading classes in localhost work just fine but when i uploaded to server a get error that can't find class. I use 000webhost.
in index page i put this code
<?php
//load classes
require_once 'inc/autoload.php';
//instatiate Core class
$core = new Core();
$core->run();
?>
in autoload.php which is in folder inc i put these code
<?php
function __autoload($class_name)
{
try
{
$class_file = 'classes/'. strtolower($class_name).'.php';
if(is_file($class_file))
{
require_once $class_file;
}
else
{
throw new Exception("Unable to load class $class_name in file $class_file.");
}
}
catch (Exception $e)
{
$e->getMessage();
}
}
?>
where the problem do i have on server to include some other path
|