View Full Version : externally loading HTML code


db1games
12-10-2004, 05:39 PM
I know how to externally load XML, CSS and Javascript code into a file, but can you do the same thing with HTML?

In my page head I have
<SCRIPT language="JavaScript" SRC="http://db1games.topcities.com/header.js"></SCRIPT> to load some code for the mouseover links - this means when I add a page I don't need to change everything.

I then have a bit lower down which says

<table>
<tr>
<td width="580">
</center><a href="http://db1games.topcities.com/index.htm"
onmouseover="buttondown('homebutton')"
onmouseout="buttonup('homebutton')">
<img src="http://db1games.topcities.com/homebutton.gif" name="homebutton" border="0" />
</a>
<a href="http://db1games.topcities.com/games.htm"
onmouseover="buttondown('gamesbutton')"
onmouseout="buttonup('gamesbutton')">
<img src="http://db1games.topcities.com/gamesbutton.gif" name="gamesbutton" border="0" />
</a>
<a href="http://db1games.topcities.com/blog.html"
onmouseover="buttondown('blogbutton')"
onmouseout="buttonup('blogbutton')">
<img src="http://db1games.topcities.com/blogbutton.gif" name="blogbutton" border="0" />
</a>
<a href="http://db1games.topcities.com/thanks.htm"
onmouseover="buttondown('thanksbutton')"
onmouseout="buttonup('thanksbutton')">
<img src="http://db1games.topcities.com/thanksbutton.gif" name="thanksbutton" border="0" />
</a>
<a href="http://db1games.topcities.com/links.htm"
onmouseover="buttondown('linksbutton')"
onmouseout="buttonup('linksbutton')">
<img src="http://db1games.topcities.com/linksbutton.gif" name="linksbutton" border="0" />
</a>
</td></tr></table>


can I put this code in an external file and then link to it from every page like I do with CSS, Javascript and XML?

If so, how?

pb&j
12-10-2004, 07:59 PM
you can use SSI or PHP to include a piece of html coding.

db1games
12-10-2004, 08:28 PM
thanks... but...

how do you do that? i don't know php at all? should I post this question in the php forums or does anyone know some simple tutorial sites for this sort of stuff?

MaGiCSuN
12-10-2004, 09:31 PM
http://www.lissaexplains.com/html6.shtml#SSI
http://www.lissaexplains.com/html6.shtml#php

Love,
Mirna

db1games
12-11-2004, 08:42 AM
thanks a lot

edit: grrr... free hosting on topcities doesn't allow .php or .shtml extensions!