Nolongerused3921 Posted September 26, 2007 Share Posted September 26, 2007 Is there any way to get the directory/path of the file running the script, not the directory you're inside (Via dir())? I'm allowing the user to navigate through directories, and that part works great - but whenever I attempt to used getcwd(), it returns the directory the user is in - not the directory of the php file - is there any way to get the directory of the .php file the user is using? Link to comment https://forums.phpfreaks.com/topic/70731-solved-getting-the-real-directory/ Share on other sites More sharing options...
HuggieBear Posted September 26, 2007 Share Posted September 26, 2007 Try the magic constant __FILE__ Regards Huggie Link to comment https://forums.phpfreaks.com/topic/70731-solved-getting-the-real-directory/#findComment-355558 Share on other sites More sharing options...
Nolongerused3921 Posted September 26, 2007 Author Share Posted September 26, 2007 Thank you so very much, saved me a lot of time Link to comment https://forums.phpfreaks.com/topic/70731-solved-getting-the-real-directory/#findComment-355563 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.