Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
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