Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Enhancing a Simple PHP Application Cleaning URLs with Subfolders Moving the Other Pages

Include the require_once("settings.php") in the header.php file

So, it seems like a lot of work to include this statement in every page, why not include it in the header.php file, as every php file in the project includes this one. Is it a bad idea?

Umy Ikem
Umy Ikem
21,383 Points

i think you're referring to the "config.php" as i dont see any settings.php in this video. With the way it's setup, since you're using the ROOT_PATH constant to include the header file then its not possible to put the constants in the header file. It would defeat the purpose of using Root Relative web addresses to include the header and footer files. I hope this is a good answer.