First, I am NOT a PHP coder, but I have to sort this out for my website.
Briefly, the PHP was updated to Version 8 and error logs have specified two fatal errors.
So I did this:
if ( ! function_exists('__autoload')) {
AutoLoader::addFolder(array(APP_PATH.DIRECTORY_SEPARATOR.'models',
APP_PATH.DIRECTORY_SEPARATOR.'controllers'));
function spl__autoload__register($class_name)
{
AutoLoader::load($class_name);
}
}
and
So I changed $param{0} to $param(0) line 8
function get_url()
{
$params = func_get_args();
if (count($params) === 1) return BASE_URL . $params[0];
$url = '';
foreach ($params as $param) {
if (strlen($param)) {
$url .= $param(0) == '#' ? $param: '/'. $param;
}
}
return BASE_URL . preg_replace('/^\/(.*)$/', '$1', $url);
}
The website is still not working. Particularly, the get_URL function returns Page Not Found
Can anyone see what's wrong?
Thank you.