If php is an option you can use the include
statement to call your header and footer whenever you need to include them in a page using <?php include 'header.php';?>
The include (or require) statement takes all the text/code/markup
that exists in a specified file and copies it into the file that
uses the include statement. Including files is very useful when you want to include the same PHP,
HTML, or text on multiple pages of a website.
Including files saves a lot of work. This means that you can create a
standard header, footer, or menu file for all your web pages. Then,
when the header needs to be updated, you can only update the
header.php file.
Let's say we have a code for the header within a file called "header.php" that looks like this:
<header class="header">Welcome to my website!</header>
To include the header file in a page, use the include statement:
<html>
<body>
<?php include 'header.php';?>
<p>Some text.</p>
<p>Some more text.</p>
<footer class="footer"> ... </footer>
</body>
</html>
When to use include and when to use require?
The require statement is also used to include a file into the HTML/PHP code.
However, there is one big difference between include and require. When a file is included with the include statement and PHP cannot find it, the script will continue to execute, while when using the require statement a fatal error will be produced:
require will produce a fatal error (E_COMPILE_ERROR) and stop the the script
Use require when the file is required by the application.
include will only produce a warning (E_WARNING) and the script
will continue
Use include when the file is not required and application should continue when file is not found.
.shtml
file extension for SSI is just the default, you can change it. In fact, you can use any file extension (or no file extension) with any server-side technology if you wish - either by changing the server config or URL rewrites in ".htaccess" (or IIS equiv). "no dynamic content in the site, so going php or asp etc is not warranted" - Well, you're dynamically including a header/footer, so why not use PHP?