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 trialWCM Operations
Courses Plus Student 15,102 PointsChallenge Task 2 of 3, I'm including ("../../htdocs/config/company.php"), but the quiz is saying it can't locate it.
The challenge asks for a relative server path to the file htdocs/config/company.php. I've included what I feel should be the appropriate relative path (along with many variants that have been unsuccessful). Any ideas what I'm doing wrong?
<?php include("../../htdocs/config/company.php"); ?>
<?php
include("../../htdocs/config/company.php");
?>
<html>
<head>
<title>Leadership | Shirts 4 Mike</title>
</head>
<body>
<h1>Leadership</h1>
<p><strong>Owner:</strong> ????</p>
<p><a href="/contact/">Contact</a></p>
</body>
</html>
1 Answer
Jeff Lemay
14,268 PointsYou did not need to include htdocs in your relative path, since the file you are including from is already in that directory.
I think this is what you are looking for (allow I don't know your whole folder structure):
<?php
include("../../config/company.php");
?>
This will take you out of the leadership folder ( ../ ), then out of the about folder ( ../ ), then into config where the file you want resides.
Jeff Lemay
14,268 PointsJeff Lemay
14,268 PointsEDIT: although not allow**
Milo Winningham
Web Development Techdegree Student 3,317 PointsMilo Winningham
Web Development Techdegree Student 3,317 PointsThis is correct, but there's a problem with the Code Challenge at the moment that's preventing the correct answer from working.
I'll see about getting this fixed, but until then the path
./config/company.php
seems to work.