phpmady Posted May 27, 2010 Share Posted May 27, 2010 Hi, How to get the root of the folder, actually am in the file.. http://localhost/project/admin/test.php how to get the project folder Thanks Quote Link to comment Share on other sites More sharing options...
ChaosKnight Posted May 27, 2010 Share Posted May 27, 2010 Is this what you are looking for?: $_SERVER['PHP_SELF']; Quote Link to comment Share on other sites More sharing options...
phpmady Posted May 27, 2010 Author Share Posted May 27, 2010 Is this what you are looking for?: $_SERVER['PHP_SELF']; No i want to get only the project folder Quote Link to comment Share on other sites More sharing options...
The Eagle Posted May 27, 2010 Share Posted May 27, 2010 Well, you have to elaborate more, we cannot go to that localhost as it is on your computer, what exactly do you want to do? <a href="/">this?</a> Quote Link to comment Share on other sites More sharing options...
phpmady Posted May 27, 2010 Author Share Posted May 27, 2010 hi, myproject_folder/admin/test.php just i want to get the myproject_folder thanks Quote Link to comment Share on other sites More sharing options...
phpmady Posted May 27, 2010 Author Share Posted May 27, 2010 Well, you have to elaborate more, we cannot go to that localhost as it is on your computer, what exactly do you want to do? <a href="/">this?</a> hi, myproject_folder/admin/test.php just i want to get the myproject_folder thanks Quote Link to comment Share on other sites More sharing options...
jskywalker Posted May 27, 2010 Share Posted May 27, 2010 take a look at: http://nl3.php.net/manual/en/function.getcwd.php if you are in : myproject_folder/admin/test.php than: getcwd() will echo "myproject_folder/admin/" chdir("..") (http://nl3.php.net/manual/en/function.chdir.php) will take you to "myproject_folder/" Quote Link to comment 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.