Where am I?
Date: 07/14/05
(PHP Community) Keywords: web
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.
Source: http://www.livejournal.com/community/php/318984.html
|