Suppose, we have three directories A
, B
and C
along with another engine
directory.
Now I want to post a search query via POST request to ../engine/search.php
in the index file of A, B and C, but tell the file search.php
to include the config.php
file from the respective directory (with different parameters for the search). I.e. I cannot simply include ../[A,B,C]/config.php
in engine/search.php
since it depends on where the search is called from.
Is there any way to do this without having to keep a separate copy of search.php
in each directory and thus including directly the config file from the respective directory? This should be possible, since similar multisite PHP setups exists (e.g. Wordpress MU).
Maybe something like __DIR__
that would give the path of where the php file gets called from rather than where it is located.
For security reasons, I do not want to pass the paths as part of the post request.