Jump to content

Include Files Problem


Z4CHH

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.