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.