doubledee Posted April 23, 2011 Share Posted April 23, 2011 In the file "secure/checkout.php" I have... <?php require_once "../config.inc.php"; ?> which is Relative. Can I use an Absolute Path instead?? Debbie Quote Link to comment https://forums.phpfreaks.com/topic/234489-can-an-include-use-an-absolute-path/ Share on other sites More sharing options...
Skewled Posted April 23, 2011 Share Posted April 23, 2011 If you give include() or require() an absolute path, that file will be included. An absolute path starts with a "/" on unix, and with a drive letter and colon on Windows. Quote Link to comment https://forums.phpfreaks.com/topic/234489-can-an-include-use-an-absolute-path/#findComment-1205121 Share on other sites More sharing options...
doubledee Posted April 23, 2011 Author Share Posted April 23, 2011 If you give include() or require() an absolute path, that file will be included. An absolute path starts with a "/" on unix, and with a drive letter and colon on Windows. So that was a "Yes" I take it? In other words, PHP accepts Relative and Absolute Path Includes, right? Debbie Quote Link to comment https://forums.phpfreaks.com/topic/234489-can-an-include-use-an-absolute-path/#findComment-1205124 Share on other sites More sharing options...
Skewled Posted April 23, 2011 Share Posted April 23, 2011 Yep Quote Link to comment https://forums.phpfreaks.com/topic/234489-can-an-include-use-an-absolute-path/#findComment-1205125 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.