LeonLatex Posted April 22, 2023 Share Posted April 22, 2023 (edited) What's the differences between include and include __DIR__ . '/../includes/DatabaseConnection.php'; Edited April 22, 2023 by LeonLatex Quote Link to comment https://forums.phpfreaks.com/topic/316187-whats-the-differences-between-include/ Share on other sites More sharing options...
ginerjm Posted April 22, 2023 Share Posted April 22, 2023 The addition of the DIR just adds more to the total path you are seeking. Quote Link to comment https://forums.phpfreaks.com/topic/316187-whats-the-differences-between-include/#findComment-1607604 Share on other sites More sharing options...
LeonLatex Posted April 22, 2023 Author Share Posted April 22, 2023 1 hour ago, ginerjm said: The addition of the DIR just adds more to the total path you are seeking. Yes, I understand that. But does it add only the www.domain, domain, or the full path from which directory on the server it is placed inside the file? Quote Link to comment https://forums.phpfreaks.com/topic/316187-whats-the-differences-between-include/#findComment-1607607 Share on other sites More sharing options...
maxxd Posted April 22, 2023 Share Posted April 22, 2023 Echo it out and see. echo __DIR__; 1 Quote Link to comment https://forums.phpfreaks.com/topic/316187-whats-the-differences-between-include/#findComment-1607608 Share on other sites More sharing options...
cyberRobot Posted April 24, 2023 Share Posted April 24, 2023 More information can be found here:https://www.php.net/manual/en/language.constants.magic.php Quote Link to comment https://forums.phpfreaks.com/topic/316187-whats-the-differences-between-include/#findComment-1607660 Share on other sites More sharing options...
ginerjm Posted April 24, 2023 Share Posted April 24, 2023 It gives you the full path to the directory you are running it from. No domain. But you have probably figured that out already Quote Link to comment https://forums.phpfreaks.com/topic/316187-whats-the-differences-between-include/#findComment-1607661 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.