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

Why was PHP tag Closed after the $_GET?

When we were checking if the $_GET["STATUS"]=="Thanks" then why was php tag closed just after the opening curly braces?

2 Answers

Patrick Gerrits
Patrick Gerrits
14,614 Points

Probably to render HTML.

If you want to show PHP in HTML it is easier to do this in plain HTML tgen rather do it with echo "<HTML>";

So when you want to combine HTML with PHP, you sometimes close the PHP tag after a function or method. TO then redner some html and when that is done open the PHP tag again to continue PHP.

Can i close the PHP tag before the curly braces...Will it effect my code?

Patrick Gerrits
Patrick Gerrits
14,614 Points

No You cant. You first need to use the { or } and then use close the PHP

Matt Campbell
Matt Campbell
9,767 Points

No you can't. There's no curly braces in HTML are there?

Patrick Gerrits
Patrick Gerrits
14,614 Points

He is asking why the php tag was closed just after the { from the PHP. He is not asking for usage for {} in HTML