[Solved] Viewing Full Path On The Server

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jimbo
Forum Newbie
Posts: 5
Joined: Wed Feb 23, 2005 12:01 pm

[Solved] Viewing Full Path On The Server

Post by jimbo »

hey guys, I don't know what command I need to use. I want to view the full path on the server, which would look something like this /home/tuxphp/public_html/findpath/filename.php

I found $PHP_SELF, but that will only give me /findpath/filename.php I need the full path starting with /home

Thanks
Last edited by jimbo on Wed Feb 23, 2005 12:42 pm, edited 1 time in total.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

look in the manual under the filesystem functions.... it's called realpath or something alike....
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Viewing Full Path On The Server

Post by Weirdan »

jimbo wrote:... which would look something like this /home/tuxphp/public_html/findpath/filename.php
http://php.net/manual/en/language.const ... efined.php

Code: Select all

echo __FILE__;
jimbo
Forum Newbie
Posts: 5
Joined: Wed Feb 23, 2005 12:01 pm

Post by jimbo »

Thanks, __FILE__ is perfect

[Topic Solved]
Post Reply