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

Oliver Williams
Oliver Williams
6,278 Points

I don't understand how the pages are able to display their h1 title when catalogue.php is not a include file.

I don't understand how the pages h1 tag are able to display a title according to the if else statement in catalogue.php seeing as catalogue.php is not an include file.

Codin - Codesmite
Codin - Codesmite
8,600 Points

Hi,

Could you link us to the video/question or paste the code here for us to see?

Than we should be able to help explain how it works.

2 Answers

Codin - Codesmite
Codin - Codesmite
8,600 Points

catalog.php is not included as it is catalog.php that is being viewed in the video, it would not need to include itself.

The header gets it's value from the GET request and the value stored in the URL.

For example http://treehouse-app.com/catalog.php?cat=music

_GET['cat'] is stored as a variable in url with the value music.

In the video Alena is using _GET variables stored in the URL to change the content of the pages header.