Answer the question
In order to leave comments, you need to log in
Why is the file not included?
Good afternoon, I have a problem with connecting a file with a class.
I made a simple SEF link system:
session_start();
$uri = trim(preg_replace('#(\?.*)?#', '', $_SERVER['REQUEST_URI']), '/');
if (gettype($uri) !== "string") {
die;
}
switch ($uri) {
case '':
include 'templates/main.php';
break;
}
include 'lib/Function.php';
$func = new Function;
$one = $func->print();
echo $one;
class Function
{
public function print() {
$one = 1;
return $one;
}
}
Answer the question
In order to leave comments, you need to log in
error 500 is a general error, that is, in fact, there can be any error, but since you have suppressed error output, a general error is given - 500. See the logs, or turn on error output to get a real error.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question