What's new
HTML Forums | An HTML and CSS Coding Community

Welcome to HTMLForums; home of web development discussion! Please sign in or register your free account to get involved. Once registered you will be able to connect with other members, send and receive private messages, reply to topics and create your very own. Our registration process is hassle-free and takes no time at all!

How to include duplicate markup in every web page

teck@jonatec.com

Junior Member
If all my web pages have the same navigation and footer markup, what is the best way of avoid hard-coding this in every page, so if it needs changing it's only changed in one place so as not to have to edit every html file?

Thanks
 
If all my web pages have the same navigation and footer markup, what is the best way of avoid hard-coding this in every page, so if it needs changing it's only changed in one place so as not to have to edit every html file?

Thanks

Do you have PHP installed? You could save the navigation in navigation.htm. Inside every page write:

<?php include 'navigation.htm'; ?>

Just edit the navigation file and all of the pages will update.
 
Do you have PHP installed?

If so, you can create a navigation.htm page and write the following on each page:

PHP:
<?php include 'navigation.htm'; ?>

You would simply edit navigation.htm for further updates.
 
Back
Top