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 Creating the Menu and Footer Including the Header

M Minnix
M Minnix
5,179 Points

Do we include everything in the 'include' header that we'd normally include in the header of the html document?

Hi, Someone previously asked about including the DOCTYPE declaration in the PHP include file (yes)...but I was wondering about everything else that we normally stick in the header. This PHP header approach is new to me and I like it but I want to make sure I don't miss anything.

So, does everything else go in: META tags, fonts to load, etc. ? My gut tells me yes- that all clients (from PC users to web crawlers) experience and treat index.php's and index.html's exactly that same way.

And in a related question, I assume that if so, there is no implication with SEO?

1 Answer

Pavle Lucic
Pavle Lucic
10,801 Points

M Minnix look on that like modular building website.

Including files like HEADER, FOOTER, SIDEBAR, CONTENT is assembling website.

Create one index.html file (like you will regulary create, with title, metas, etc) , and then create index.php (chop header and footer into separate files, and then include them into index.php).

When you finish with that, go to the both files (index.html and index.php) , and use VIEW PAGE SOURCE.

You will notice that the both files looks the same. And that is the answer.