Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Build a Basic PHP Website (2018) Building a Media Library in PHP Including the Footer and Adding Additional Pages

meli fas
meli fas
2,015 Points

How suggest.php works??

Hi What i dont understand is that in suggest.php file which in the beggining is an empty php file, we do include the header.php which is an incomplete, short of speaking, html format since it doesnt have the html and body closing tags.(this tags remained in index.php) So how does that file works and outputs results in browser since is an incomplete html format?? Regards

1 Answer

From my understanding youre right and it is not best practice, but the browser often understands html even if it isnt correct. for example just "test-sentence" works as an html document, without the <body> and <html> tag. The problems begin in bigger files, when the browser will not always "guess" correctly what you meant with your false syntax. Hope I understood youre question right.