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? Quote 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 Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.