Image

Imagedivineright wrote in Imagephp

Where am I?

Hello All.
I am writing an app that emails a document located in a directory below the root of the website.

site/documents/file.txt

I want to be able to figure out what the path to the file is dynamically so that the app is portable.

I am doing it this way for now and it seems to work.

$x = pathinfo($_SERVER['SCRIPT_FILENAME']);

$path = $x['dirname'] . '/docs/';

Is this a correct method? How do you do it?

Thanks.