I'm trying to make includes dynamically in my php script. This is my directory tree:
-index.php
-sources/
--hello.php
--bye.php
In my index.php
I make an include of hello.php:
include("sources/hello.php");
In my hello.php
I have another include of:
include("bye.php");
When I access the index.php
it throws an error saying:
Message: require_once(bye.php) [function.require-once]: failed to open stream: No such file or directory
Is there a way to get it works but without absolutes paths? because the paths can be changeable from one directory to another but keeping the structure:
-index.php
-sources/
--hello.php
--bye.php