Page 1 of 1

Finding out current path of script

Posted: Tue May 27, 2003 2:38 pm
by Trip1
I have a really easy Q for you guys, looked around for it on google and php.net but couldn't an answer

What i am trying to do is find out the current path of the script im running, and then use the basename function to figure out the base name of the path.

Posted: Tue May 27, 2003 2:56 pm
by AVATAr
check this out:
- http://www.php.net/variables.predefined
- http://www.php.net/manual/en/reserved.v ... les.server

Code: Select all

<?php
echo $_SERVER['SCRIPT_FILENAME'];
?>

Posted: Wed May 28, 2003 4:18 am
by sleepingdanny
This will show you the path to the script you are running:

Code: Select all

_FILE_