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 PHP Basics PHP on the Web Including PHP

Help me answer this question. I'm not sure what's wrong with my answer

Good luck

index.php
<html>
<head>
<title>A Few of My Favorite Things</title>
</head>
<body>
<h1>A Few of My Favorite Things</h1>
<?php inc 'favorites.php'; ?>
</body>
</html>

1 Answer

Jonathan Tebb

Here is the solution I came up with to complete the challenge. The first thing I did was replace inc with the include php keyword. Next, the challenge was looking for favorites.php in the inc directory so I added inc/ in my path name. I hope this helps you out!

<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>

Thanks that's really helpful and I can answer the question correctly now and my general coding has improved :)