include problems with folders
Posted: Mon Oct 11, 2010 10:20 pm
Hello
I've got three files:
index.php
system/page.php
system/lib.php
When I now open the file index.php with my browser, everything is fine. But when I open the file system/page.php, there is an error that the file lib.php cant be found.
That means that php includes the files relative to the path of the first executed file. Is there a possibility to use paths relative to the file where I specified the include?
I've got three files:
index.php
Code: Select all
<?php
echo "hello";
include ("system/page.php");
echo "bye"
?>
Code: Select all
<?php
include ("system/lib.php");
print_content();
?>
Code: Select all
<?php
function print_content(){
echo "bla bla bla";
}
?>
That means that php includes the files relative to the path of the first executed file. Is there a possibility to use paths relative to the file where I specified the include?