I have structured a server with this file and folders:
index.php
|lib -> lib.php
|framework -> fw.php
|folderA -> index2.php
In lib.php there is functionA() with a require_once inside that calls "fw.php" correctly from index2.php:
functionA(){
require_once "../framework/fw.php";
//other stuff...
}
if it's called from index.php, the path must be changed. I really need a method to include paths dynamically without setting up a specific code inside every page.
Does exist a method to fix the path?
I tried to use __FILE__, dirname()...but without a satisfied solution.