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 trialDave Cleaves
1,835 Pointsfavorites.php file does not exist
Hi,
I have run the script: <?php include 'inc/favorites.php'; ?> below the heading 'A Few of My Favourite Things'. However because the file favourites.php doesn't actually seem to exist the code will not run.
Can you help please?
Thanks
Dave
<html>
<head>
<title>A Few of My Favorite Things</title>
</head>
<body>
<h1>A Few of My Favorite Things</h1>
<?php include 'inc/favorites.php'; ?>
</body>
</html>
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! You've included a favorites.php from inside a folder called "inc". However, for the challenge this folder doesn't exist. Try removing the "inc" folder and just include the file. In this scenario it's located in the current directory. Hope this helps!
Josh Foster
8,896 PointsThe include function takes arguments within parentheses. Your included file must be contained within parentheses like this: <?php include('inc/favorites.php'); ?>. Hope this helps.
Dave Cleaves
1,835 PointsHi Josh,
Thanks for the advise.
Dave
Dave Cleaves
1,835 PointsDave Cleaves
1,835 PointsHi Jennifer,
Thanks for your response, you were absolutely right.
Thanks
Dave