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

Jaime Rios
PLUS
Jaime Rios
Courses Plus Student 21,100 Points

What am I doing wrong here?

I am having troubles with the challenge, but I watched the video four times and I still don't get it. This is the code I've been trying

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>

2 Answers

Sean T. Unwin
Sean T. Unwin
28,690 Points

The issue is that there is a space between include and the opening bracket. Functions cannot have a space between the function name and the arguments parenthesis.

Jaime Rios
Jaime Rios
Courses Plus Student 21,100 Points

Thanks so much. Does it applies also to JavaScript or other programming languages?

Sean T. Unwin
Sean T. Unwin
28,690 Points

Does it applies also to JavaScript or other programming languages?

This applies to many languages. Javascript, however, has a more loosely typed syntax than a language like Python, so JavaScript will usually be able to parse the code if there is a space after the function name.

Jaime Rios
Jaime Rios
Courses Plus Student 21,100 Points

I was not aware of that. Thanks again, I appreciate it.

I'm a newbie php coder but the include function is used when u gt some code you want to use in multiple files so you write it in one file and when u use the include function above it copies the code from the included file onto the file u want to use it in.... If it only contains <?php echo "hi budd"; ?> this code replaces the include line of code