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 trialCoskun Olcucu
4,562 PointsROOt_PATH and BASE_URL is not working
Hi All, ROOT_PATH and BASE_URL is not working. i defined them as a constants.However,no luck to get the desired outcome.
I did everythhing like Randy did.
3 Answers
Amy Kang
17,188 PointsI had to include the config file in the header for it to work.
Put this above the html in your header file:
<?php require_once("config.php"); ?>
Coskun Olcucu
4,562 PointsI did the modification like you said by including config.php to header.It still doesn't work. I don't know how Randy get it work.
Caesar Bell
24,829 Pointssend a snipped of your code.
Michael Tigue
4,799 PointsI placed this at the top of my header file and it works:
<?php require_once "inc/config.php"; ?>
I had to specify the path to the config file, which included the /inc folder.
Pedro Dasilva
8,291 PointsPedro Dasilva
8,291 PointsGot it !!! Worked like a charm. thanks
Caesar Bell
24,829 PointsCaesar Bell
24,829 PointsGood catch. I was having the same issue but it worked for me as well, I forgot that i had the config.php in the same include file as my header and footer.php