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,218 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!