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 trialAlex Watts
8,396 PointsWhat does '?status = thanks' do in PHP?
Hello,
I do not know what '?status = thanks' does in my PHP code (see below):
header("location:index.php?status=thanks");
Thanks :)
2 Answers
Kevin Korte
28,149 PointsIt sets a $_GET
variable status, equal to thanks
That's helpful, cause later in your code, you can check if $_GET['status']
is set, and if so, is it $_GET['status'] == 'thanks'
, and if that's true, you can show your "Thank You" message confidently to your user, thanking them for the action they just took (like a form submit).
Alex Watts
8,396 PointsOk thanks, this makes more sense now :)