I want a page that's loaded to know which directory on my site it is in.

One question: Why? Maybe there's a better way to achieve what you're trying to do.
_________________________
-- roger