maccy93 Posted November 21, 2011 Share Posted November 21, 2011 ../ tells the php program to go up a level. require_once '../directory/somefile.php'; Is there a shortcut to go to the public web folder? For example. The following file is placed 3 folders deep: "var/www/deep/deeper/verydeep/index.php" and it requires a file with location: "var/www/thisfile.php" I there a short cut/ quicker method to?? require_once '../../../thisfile.php'; Quote Link to comment https://forums.phpfreaks.com/topic/251572-shortcut-back-to-the-web-public-folder/ Share on other sites More sharing options...
requinix Posted November 21, 2011 Share Posted November 21, 2011 Try $_SERVER["DOCUMENT_ROOT"]. Quote Link to comment https://forums.phpfreaks.com/topic/251572-shortcut-back-to-the-web-public-folder/#findComment-1290166 Share on other sites More sharing options...
maccy93 Posted November 21, 2011 Author Share Posted November 21, 2011 Ha! brilliant thank your very much. That will now safe me lots and lots of time! Quote Link to comment https://forums.phpfreaks.com/topic/251572-shortcut-back-to-the-web-public-folder/#findComment-1290175 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.