several html pages with the same header and footer

hello folks
Could please anybody tell me what the best approach is to build a website which has 5 html pages with same header and footer and all of them with static content?
Two ideas came to my mind but i don’t know which one is the best to make the code more professional in this case:

First approach: develop 5 html files

Second approach: develop one php file in which there is a header and a footer. And then make the content between the
header and footer dynamic with php in order to have the 5 html pages just in one php page.

I look forward to seeing your replies.
Thanks.

Hello,
I’m not sure if this is the ‘right’ way to do it, but I’ve always created a header.html (or php) and footer.html and then just create individual content pages. In the content pages you just use the php include to tack on the header and footer.
include(‘header.php’);

// page content

include(‘footer.php’);

Just my two cents.

thks

A good 2 cents it is too… That is exactly the way to do it.

I take it a step further, I try to create the WHOLE website around the same type of theme. I have a “Skeleton” Page that has the “Includes” for the Header, footer, links, favs, ads, etc… and in the “Content” section of the page, I have an include for the main content. That way when it comes time to “Update” a section, I only need to do it ONCE. Great time saver (in the long run).

Sponsor our Newsletter | Privacy Policy | Terms of Service