Forum Moderators: open

Message Too Old, No Replies

Adding a footer to the bottom of HTML pages

How to do without retyping every time...

         

eggy ricardo

1:00 pm on May 15, 2004 (gmt 0)

10+ Year Member



Hi guys...

This may seem a silly question but i cant think of a solution for the life of me. I have a site with several pages written as HTML. I want to add a footer to the bottom of each page with copyright and privacy policy etc on. Is there a way i can do it to only make the footer once and have it replicated on each page without copying the code across for each page?

Hope that makes sense

Thanks

encyclo

1:42 pm on May 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to search for SSI, or server-side includes, which will enable you to insert the same code snippet into each page automatically. It can also be done with PHP or any other scripting language (ASP, Perl, etc.)

dreamcatcher

2:00 pm on May 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you only have a simple link or something, then you can create an external javascript file and use document.write. This is very limiting though.


document.write('<center>');
document.write('<a href="./link.html">Your Link</a> ');
document.write('</center>');

then use:

<SCRIPT LANGUAGE="JavaScript" src="footer.js">
</script>

Personally I use PHP includes.

wavebird23

2:50 pm on May 15, 2004 (gmt 0)

10+ Year Member



Put the following script at the bottom of all your pages, the copyright year will update every new year. You can even add a link to your privacy policy in this script. NOTE: When you see this tag:
-----------------------------------------------------
<center>Copyright © 1997-<SCRIPT LANGUAGE="JavaScript">
-----------------------------------------------------
Be sure to replace 1997 with the year that your website was first copyrighted on!
Here is the script:
______________________________________________________
<SCRIPT LANGUAGE="JavaScript">
<!--
today=new Date();
y0=today.getFullYear();

// end hiding --->
</SCRIPT>

<center>Copyright © 1997-<SCRIPT LANGUAGE="JavaScript">
<!--- Hide from old browsers
document.write(y0);
// end hiding --->
</SCRIPT> <a href="http://www.yoursite.com/privacy">Click here for our privacy policy</a></center>
______________________________________________________

Good luck with your site!

eggy ricardo

9:52 pm on May 15, 2004 (gmt 0)

10+ Year Member



Thanks for the input guys.

I used dreamcatcher's javascript suggestion as its simple and the book about html i am reading touches on the basics. It is working a treat. Thanks again

will1480

3:00 pm on May 16, 2004 (gmt 0)

10+ Year Member



yeah, you can do all of these things as well, or you can use ilayer. The problem is in making your links cahnge the main page. iframe works like frames and I dont really know how to use them well. example:
<iframe id="datamain" src="URL_of_HTML_file" width=125 height=125 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></iframe>

Also, I am not sure about what browers exactly support this. I know newer NS and IE do, but not sure about NS4