Well, this is common in websites. You create two files, header.php and footer.php. Each page on the site
would then include both of these, one at the top and the other at the bottom. They can be named anything
that fits your use. Some programmers use inc_header.php to indicate it is an included file, but, I just name
them header and foot. So, the base info in each would be like this… (loosely, just a base idea for you.)
Header.php:
<?PHP
session_start();
// ... ANY PHP code needed common to all pages...
?>
<html>
<head>
... Header entries ...
</head>
<body>
<div>
... ANY general layout code to display your header that is the same on every page.
... Usually this area contains your top menus which are the same on every page.
</div>
--------------------------------------------- end of file… Ends without finishing the page of course…
Footer.php:
<div>
.... Your copyright footer including links to outside pages, or company info or whatever you want
... at the bottom of every page ...
</div>
</body>
</html>
--------------------------------------------------------------------End of file ending like any normal page…
In ALL other pages, you would create them like this…
ANY-OTHER-FILE.php
require_once("header.php");
<div>
... Some code displaying whatever is needed for each separate page...
</div>
require_once("footer.php");
--------------------------------------- This will let every page have the exact same header and footer.
It also makes it super easy to alter the header of footer for EVERY page with just one simple edit.
Let’s say you need to alter your copyright notice in the footer, just change it once in the footer.php file.
You can also add other includes if you need the same code in several files. Like if your project includes
the same data displays on 3 or 5 or 20 pages, you can put that into a separate included file, too.
Hope this example helps…