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 Build a Basic PHP Website (2018) Building a Media Library in PHP Including the Header

I get a HTTP ERROR 500 when trying to view the browser..

i don't know whats wrong, i did the same as she but it just wont work?

Maps : inc

  • header.php

index.php suggest.php

index.php ''' <?php include("inc/header.php"); )?> <div class="section catalog random">

        <div class="wrapper">

            <h2>May we suggest something?</h2>

            <ul class="items">
                <li>
        <a href="#">
          <img src="img/media/forest_gump.jpg" alt="Forrest Gump">
          <p>View Details</p>
        </a>
      </li>
      <li>
        <a href="#">
          <img src="img/media/princess_bride.jpg" alt="The Princess Bride">
          <p>View Details</p>
        </a></li>
      <li>
        <a href="#">
          <img src="img/media/elvis_presley.jpg" alt="Elvis Forever">
          <p>View Details</p>
        </a>
      </li>
      <li>
        <a href="#">
          <img src="img/media/garth_brooks.jpg" alt="No Fences">
          <p>View Details</p>
        </a>
      </li>                             
            </ul>

        </div>

    </div>

</div> <!-- end content -->

<div class="footer">

    <div class="wrapper">

        <ul>        
            <li><a href="http://twitter.com/treehouse">Twitter</a></li>
            <li><a href="https://www.facebook.com/TeamTreehouse">Facebook</a></li>
        </ul>

        <p>&copy;<?php echo date("Y")?> Personal Media Library</p>

    </div>

</div>

</body> </html> '''

suggest.php ''' <?php include("inc/header.php"); ?>

<div class="section page"> <h1>Suggest a Media Item</h1> </div> '''

header.php ''' <html> <head> <title><?php echo "Personal Media Library"; ?>Personal Media Library</title> <link rel="stylesheet" href="css/style.css" type="text/css"> </head> <body>

<div class="header">

    <div class="wrapper">

        <h1 class="branding-title"><a href="/">Personal Media Library</a></h1>

        <ul class="nav">
            <li class="books"><a href="#">Books</a></li>
            <li class="movies"><a href="#">Movies</a></li>
            <li class="music"><a href="#">Music</a></li>
            <li class="suggest"><a href="suggest.php">Suggest</a></li>
        </ul>

    </div>

</div>

<div id="content">

'''

1 Answer

Joel Bardsley
Joel Bardsley
31,246 Points

Before your first code block (index.php ?) you have the following issue:

<?php include("inc/header.php"); )?>

You have an extra closing parenthesis after your include statement. Try removing this and see if that makes a difference.

thanks!