I'm sure this is simple enough, I just can't work it out.
I have a ton of websites with the same menu so rather than having loads of includes I have one which powers the menu on all the sites. I need to get the current page URL from that file, but it just returns the path relative to the include.
So, for example, I have a file at example-external.com/inc/myfile.php. That file is included at example.com/index.php. The code must go in myfile.php and it should return example.com/index.php.
However, no matter what magic constant (tried __FILE__) or $_SERVER variables... Nothing. Maybe it's not possible, any ideas?
Thanks in advance