View previous topic :: View next topic |
Author |
Message |
Digitalmike -
Joined: 09 Aug 2006 Posts: 22
|
Posted: Sun Oct 01, 2006 7:39 pm Post subject: Direct Path Question |
|
|
I am trying to figure out my direct path for a php script I'm using. Any ways I can figure this out?
I have my project/site folder in the htdocs folder. So would my path be
/htdocs/foldername/ ?
Thanks |
|
Back to top |
|
|
Mikor -
Joined: 21 Aug 2006 Posts: 144 Location: Hull, England
|
|
Back to top |
|
|
pkSML -
Joined: 29 May 2006 Posts: 952 Location: Michigan, USA
|
Posted: Sun Oct 01, 2006 9:35 pm Post subject: |
|
|
Make a PHP file and the contents will be this: Code: | <?php phpinfo(); ?> |
Scroll down the page to the Environment section.
You'll see SCRIPT_FILENAME. This is the disk path to your script. Use it for includes or anytime the real path is needed.
You'll also see SCRIPT_NAME. This is the path relative to the server. Use it for links.
BTW, inside your script, these variables exist as $_ENV[SCRIPT_FILENAME] and $_ENV[SCRIPT_NAME] or $_SERVER[SCRIPT_FILENAME] and $_SERVER[SCRIPT_NAME]. _________________ Stephen
Need a LitlURL?
http://CodeBin.yi.org |
|
Back to top |
|
|
|