I have a script that can be included on any other page of the user's choosing for their convenience, but the only problem here is that I have no way of knowing the source directory of the included file. I would like the script to include other files and display images from the same directory that it is in, but if it's included on another page in a different directory, I can only get the location of the current directory, which of course would produce an error. Is there no way for PHP to get the original source directory of the included file?
PS - Don't tell me to just ask the user to give the directory path, I know I can do this - what I want is to make the script more flexable and easier by not having the user have to change lots of variables. I am looking for an automated way of doing this.