Jump to content

several html pages with the same header and footer


thosecars82

Recommended Posts

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 only 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.

You could also do it like:

<?php

include("header.php"); // of course, you could just add the code from header into this page

include($_GET['page'] . ".php"); // index.php?page=hello, etc

include("footer.php"); // ditto

?>

You'll have to make it slightly more secure, but this is the general idea.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.