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!
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
Cant pass the previous question, preview said 'cant find favorites.php'
is there an error?
The instructions state that the favorites.php file is in the current directory. For files in the current directory you simply include the file name [<?php include 'favorites.php';?>] instead of the previous example that were in the "inc" directory [<?php include 'inc/favorites.php';?>].
David Grimm12,532 Points
Exactly the same happened to me, but then I noticed I've forgotten semi-colon at the end of the statement.
The preview seemed OK, but evaluation wouldn't let you through. After adding semi-colon, it was OK.
The evaluation is quite rigid, but I don't think that one should just give up on it, just because you migh think you have it right according to the Preview :)
please post your code here, so that we can see what you are doing wrong. As Leonardo and Daniel said, since the 'favorites.php' file is in the same directory, you just have to include it by adding the following code to your current file: <?php include('favorites.php'); ?>. This code should be placed below the heading <h1></h1> tag.
some of these php code challenges are broken. I just tested this one and even when I can see the preview with the included file, it still says its not included when I click check work. I've noticed several of these types of issues with the php code challenges.
Leonardo Da CostaFront End Web Development Techdegree Graduate 14,559 Points
Below the <h1> tag:
<?php include 'favorites.php'; ?> // since its in the same directory, you can just insert the php file
Is that what you put ? I hope I could help, good luck.
you need to enter your code in between the <h1> </h1> tag your code should be like <?php include 'favorites.php '; ?> it should come correct
<?php include 'favorites.php';?> afther the heading tag "<h1></h1>" Good luck