A simple Solution?

Discussion in 'Web Design and Development' started by triton, Aug 16, 2006.

  1. triton macrumors regular

    Joined:
    Jul 15, 2003
    #1
    Hello,

    I have to periodically update a copyright footer on several html pages, but do not want to have to update each and every single page to do this.

    Is there a way to update one page and have that universally linked onto each page? :confused:
     
  2. CoMpX macrumors 65816

    CoMpX

    Joined:
    Jun 29, 2005
    Location:
    New Jersey
    #2
    I don't know much about HTML, but I think I have a solution for you.

    Save the copyright notice as an image file. Then host this image on your server, ad link the image onto the bottom of every page.
    This way, when you update your copyright notice all you have to do is host the new image file and link to it. It will change on all of the pages.

    Too complicated? Maybe someone has a better way?
     
  3. buzzmedia macrumors newbie

    Joined:
    Aug 16, 2006
    Location:
    Windsor, ON
    #3
    You can do this a few ways. The easiest way is to use a server-side scripting language like PHP, ASP, SSI, etc. and code your footer as a separate page, and then "include" it in all of your other pages. This way, you make the change once, and all other pages will get updated automatically. If PHP, ASP, etc. is not an option, then you can do the same thing using Javascript. Within each page on your site, include a link to a javascript file. For example:

    Code:
    <script language="JavaScript" src="JAVASCRIPTFILENAME.js"></script>
    Within that Javascript file, include a function called "writeFooter" (or whatever you want to call it) that looks something like this:

    Code:
    function writeFooter() {
     document.write("Copyright 2006 - My Site & Me");
    } 
    Then at the bottom of each page where you want the copyright information in your HTML, put this line

    Code:
    <script>writeFooter();</script>
     
  4. Butters macrumors 6502

    Joined:
    Jan 7, 2006
    Location:
    UK
    #4
    if your host supports php scripting

    type
    Code:
    <? include 'footer.php' ?>
    at the bottom of everypage where you want the copyright notice to appear

    and then make a new file called footer.php and type the copyright notice into it, upload the file to your server and now wherever the include footer code appears it will grab footer.php and include it

    edit: was beaten to the solution, both ways will work this one and the one mentioned above.
    also, if you use the php method make sure ur html files are saved with the .php extension
     
  5. elppa macrumors 68040

    elppa

    Joined:
    Nov 26, 2003
    #5
    Butters solution is far better.

    Anything that uses javascript can be (and frequently is) turned off.
     
  6. triton thread starter macrumors regular

    Joined:
    Jul 15, 2003
    #6
    Thank you, I'll let you know how it goes ;)
     

Share This Page