Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.