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

Paul Heneghan
Paul Heneghan
14,380 Points

<?php include 'inc/favorites.php'; ?> also put file in inc in workspace

Repeated error msg: "don't forget to INCLUDE file" the include statement is correct, and the file exists in the inc folder in my workspace. How hard can this be???

Paul Heneghan
Paul Heneghan
14,380 Points

Thanks for the quick response, Darrell. I tried that, and every variation I could think of: in-line <php?, double-quotes, single. etc. The lesson before this challenge shows the format as I originally wrote, but nothing works, and all generate that same error.

4 Answers

Matthew Carson
Matthew Carson
5,965 Points

The file isn't in an 'inc' directory. It's in the same directory as the current file you are in.

<?php include 'favorites.php'; ?>

They should have foreseen this as a possible mistake and given better feedback.

Paul Heneghan
Paul Heneghan
14,380 Points

Thanks, Matthew. I thought the same thing earlier, tried it along with all the other variations, but that error msg persists. Just tried it again to make sure I hadn't fat-fingered it, but nope. It just doesn't like any valid answer.

Matthew Carson
Matthew Carson
5,965 Points

Really?

Double checking by copying that line onto line 7 of the code challenge passes for me.

If yours isn't working that is definitely strange.

Paul Heneghan
Paul Heneghan
14,380 Points

Thanks for mentioning that, Matthew. I'll try it in another browser and/or computer now. Very weird.

Paul Heneghan
Paul Heneghan
14,380 Points

AAAARGGGH!!! to infinity.

Chrome did it. Firefox, pffft.

Leah Haist
Leah Haist
20,547 Points

This is the correct answer: <?php include('inc/favorites.php'); ?>