Search code examples
htmluniversal

"Universal" links in HTML?


Possible Duplicate:
Include one HTML file in another HTML file

On each of the pages on my website I have a footer that contains about 12 links. Every time I want to change a link, I have to do it on every single page. Is it possible to make it so I can somehow change the link in one place and it changes on every page? Thanks.


Solution

  • This exact problem is the beauty of serverside scripting, where you can define a header file that each page pulls from when it is retrieved, allowing you to change a single file and have the changes propagate your entire website.

    This is what it could look like in PHP:

    header.php - <a href="link">Link</a>

    all_other_pages.php - <?php include header.php; ?> ...