| How do I include one HTML file in another? |
| User Opinions |
|
No users have voted.
|
|
Thank you for rating this answer.
|
Use "server side includes" in your HTML. Not all web servers support this, and some require that you name your file .shtml rather than .html in order to enable the parsing of your file by the server in order to find server side include directives.
Of course, server side includes only work when a web server is being used to access your pages. This is only an issue when testing your pages on your local hard drive. If this becomes a problem, it may be time to install a web server on your own computer, for local testing purposes.
A simple server side include directive to include another file looks like this:
< !-- #i nclude file= " insertthisfile.html " -->
There are many more server side include directives available; for example, you can easily insert the current date into your page. For more information, see the Apache server side includes tutorial, which also covers how to configure the free Apache web server correctly with support for server side include directives.
|
| Visitor Comments |
|
No visitor comments posted. Post a comment
|
| Attachments |
|
No attachments were found.
|