Page 1 of 1

finding directory that a script is running in?

Posted: Thu Sep 18, 2003 1:04 am
by toms100
for the current project im doing,i need to .htaccess protect adirectory so that noone can enter and a php script can pull files from it.
as i want it to be easily instaled, is there a quick and simple way to find the directory a script is running in?
hope someone can help

Tom

Posted: Thu Sep 18, 2003 2:57 am
by JayBird
How about

Code: Select all

<?
print(dirname(__FILE__));
?>
Mark

Posted: Fri Sep 19, 2003 5:17 am
by toms100
ah ha!!!
thanks very much Bech, worked beautifully ;)

Tom