I have to files includer.php adn inc.php and I am including inc.php within includer.php, inc.php opens a file that is located in its folder: fopen("file", "r"); but when i include inc.php in includer.php this code wont work because he'll search the file in the folder of includer.php. Now how can i get the location of inc.php before it is included ?
i can do this in includer.php:
$path = "includes/dir/incme";
include($path/inc.php);
and in inc.php to use:
fopen("$path/file", "r");
BUT I want to make it with only
include("includes/dir/incme/inc.php"); in includer.php.
Any suggestions ?