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 Enhancing a Simple PHP Application Cleaning URLs with Subfolders Server Paths and Constants

Jimmy Maurice
Jimmy Maurice
9,379 Points

I don't understand this question. I thought the answer was : <?php include("../../config/company.php"); ?> ???

Any ideas ?

about/leadership/index.php
<?php 

include("../../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>

5 Answers

Chase Swanson
PLUS
Chase Swanson
Courses Plus Student 8,886 Points

The exercise just wants you correct the path in the actual HTML <p>, not add an include.

Jimmy Maurice
Jimmy Maurice
9,379 Points

Thank's for your answer @Chase Swanson. I was talking about the second question of the quizz. "There is a file located at htdocs/config/company.php on the server...

Chase Swanson
PLUS
Chase Swanson
Courses Plus Student 8,886 Points

Oops, sorry about that.

htdocs is setup as the root essentially so you need to have a relative path from that.

Your code is looking up two levels from the config folder when in fact it should start at config "config/company.php"

Jimmy Maurice
Jimmy Maurice
9,379 Points

it's exactly what i thought but it didn't worked. As you can see on the capture above i tried this :

<?php 

include("../../config/company.php");

?>

But i finally found the good answer in another forum. Thank's a lot ! Don't remember where exactly..

Alena Holligan
STAFF
Alena Holligan
Treehouse Teacher

Code Challenge was not working properly and has been fixed now :)

Give it another try and see if it works as you expect