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 Working with _GET Variables

[SOLVED] The $_GET variable does not set up in the browser!

For example when i press on books it just goes to catalog.php, not catalog.php?cat=books and i did all that was done in the video please help me!

Jeff Lemay
Jeff Lemay
14,268 Points

Post your code here so we can take a look.

thanks but i found my solution

Jeff Lemay
Jeff Lemay
14,268 Points

Awesome. Would you mind posting your solution as an answer below so the question can be marked as resolved?

added [SOLVED] to title

1 Answer

jason chan
jason chan
31,009 Points
// catalog.php
<?php 
$pageTitle = "Full Catalog";
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 page">
    <h1>Full Catalog</h1>
</div>

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

Don't forget to CTLR-S