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

Aaditya Raj
PLUS
Aaditya Raj
Courses Plus Student 3,130 Points

This page isn’t working port-80-cm5qj5quc1.treehouse-app.com is currently unable to handle this request. HTTP ERROR 500

The navigation menu is not working after adding : $_GET to get the title of each item. After adding :

<?php

$pageTitle = "Full Catalog";

if (isset($_GET["cat"])) {

if ($_GET["cat"] == "books") { 
    $pageTitle = "Books"; 
} else if ($_GET["cat"] == "movies") { 
    $pageTitle = "Movies"; 
} else if($_GET["cat"] == "music" { 
    $pageTitle = "Music"; 
} 

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

<div class="section catalog page"> <div class="wrapper"> <h1><?php echo $pageTitle; ?></h1> </div>

</div>

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

1 Answer

Hey Aaditya - You're missing a closing paren:

<?php
//
} else if($_GET["cat"] == "music" { // here

Hope that helps.

Cheers,

Ben

Aaditya Raj
Aaditya Raj
Courses Plus Student 3,130 Points

Thank you, but i got it fixed after writing all the code again.