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 Simple PHP Application Adding a Contact Form Working with Get Variables

Working with Git Variables

I'm just trying to understand exactly how the header function with a ternary operator works. From the lesson, there is this code:

header("location: contact.php?status=thanks")

So, the browser redirects to the full string above, if status shows a value of "thanks"? I don't, however, see anything anywhere else that indicates the value of "status". Am I reading it wrong?

Never mind. I get it. It's been a while since I delved into this stuff. I forgot how it worked. It's basically just creating a $_Get variable called status and giving it the value of "thanks, then appending that to the end of the url. I was trying to see it as a more complicated if/else statement than it is.