Page is a not externally linkable
swa66 - 3:44 pm on Sep 24, 2012 (gmt 0)
I'd reference most "static" images etc. with an absolute path as well.
Yet, there are instances where a script needs to know a bit more about where it is being called/included:
The $_SERVER array contains a number of variables that are useful to determine the location of a php script.
$_SERVER['REQUEST_URI'] is probably the one you can work from, but there are many others, print out $_SERVER to get a better idea.
ref: [php.net...]