I am not sure how to explain, the above did exactley what my code did and both work only in some situations:
I have one main file (x2.php) that loads the code by include but with FULL path:
in x.php (the included file) I have:
So when I access
www.adriantnt.com/x2.php which has x1 in it I get:
"www.adriantnt.com/x.php"
And what I want to get is the file I typed in address bar, x2.php not x.php
The code displays the corect path if at include I type a relative path like:
But all my site is made to include the files with full path:
Is there a way or a function to return the parent file name or its path? in this case name is x2.php
Thank you.
-Adrian.