Z4CHH Posted June 20, 2007 Share Posted June 20, 2007 I am having a problem including files. I can include a file but the includes in that file get messed up because everything is in a different directory. Anyone have a practical approach to setting a reference point for including files? Like define the main folder of your project as your reference point somehow and use that? Like: include($project_root_dirc.'file.php'); I don't know what i can do to get this to work practically.. Thanks, Zach Link to comment https://forums.phpfreaks.com/topic/56468-include-files-problem/ Share on other sites More sharing options...
trq Posted June 20, 2007 Share Posted June 20, 2007 How about using $_SERVER['DOCUMENT_ROOT'] as your starting point? Link to comment https://forums.phpfreaks.com/topic/56468-include-files-problem/#findComment-278886 Share on other sites More sharing options...
Z4CHH Posted June 20, 2007 Author Share Posted June 20, 2007 How about using $_SERVER['DOCUMENT_ROOT'] as your starting point? That could work but I need the root of my project folder, so if the folder name changes I will be good to go still. phpBB i noticed uses $phpbb_root_dirc something like that...as if it were a built in global Link to comment https://forums.phpfreaks.com/topic/56468-include-files-problem/#findComment-278890 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.