several html pages with the same header and footer

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thosecars82
Forum Commoner
Posts: 94
Joined: Thu Apr 03, 2008 6:31 am
Location: Arganda, Madrid
Contact:

several html pages with the same header and footer

Post by thosecars82 »

hello folks
Could please anybody tell me what the best approach is to build a website which has 5 html pages all of them with the same header and footer and with only 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.
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Re: several html pages with the same header and footer

Post by Bill H »

I would take the approach of making one php script that produces five html pages.

At just five pages it's probably a bit minor, but if changes need to be made to the header/footer, you would only have to make the change one place.

I'm probably biased, since I spend most of every day sitting at a computer composing php scripts that output html pages.
thosecars82
Forum Commoner
Posts: 94
Joined: Thu Apr 03, 2008 6:31 am
Location: Arganda, Madrid
Contact:

Re: several html pages with the same header and footer

Post by thosecars82 »

thks for that
Post Reply