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

<?php include "favorites.php" ?> please its not work

<?php include "favorites.php" ?>

help me for solve this problem..its not work

index.php
<html>
<head>
<title>A Few of My Favorite Things</title>
</head>
 <?php 
    include "favorites.php" 
  ?>
<body>

<h1>A Few of My Favorite Things</h1>

</body>
</html>

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! You're super close on this one. First, as stated in the instructions, the favorites.php resides inside the inc folder. Your code is looking for it in the same folder as this file. So the path needs to be adjusted. Secondly, the include is supposed to come under the heading, but yours comes under the head. Remember, that in HTML we have a <head>, <header>, and headline elements and they all do different things. Headlines are denoted with <h1> through <h6>.

The path you need is: include "inc/favorites.php", but I'm going to leave the placement up to you.

Hope this helps, but let me know if you're still stuck! :sparkles: