Need some html help please

coomarlin

Senior member
Dec 19, 2000
796
0
71
I'd like to embed an html file inside another webpage. For example I'd like to have a copyright page so that when I update it I'll only have to do it to the copyright page instead of all of the pages the copyright is located on. I've been informed that my webserver does not support SSI.

What would be the best way to do this? And could someone please give me an example of the code. Thanks.
 

Need4Speed

Diamond Member
Dec 27, 1999
5,383
0
0
not sure if this can be done with java/javascript, but it can be done with cgi and php. first find out what scripting your hosts supports.
 

Need4Speed

Diamond Member
Dec 27, 1999
5,383
0
0
php ---> <?php include('navigasjon.html'); ?>
cgi ----> <!--#exec cgi="scriptname.cgi" --> or <!--#include file="myfile.txt" --> or <!--#include file="myfile.html" -->
 

Mitzi

Diamond Member
Aug 22, 2001
3,775
1
76
It can be done using CGI and the like but a much simpler solution is to use frames.
 

Need4Speed

Diamond Member
Dec 27, 1999
5,383
0
0
without getting into internet etiquete, yes frames will work. IMHO though, frames are useless as not all browsers deal with them in the same manner and i would only use them as a last resort if scripting is not available. besides, its not exactly difficult to use a cgi or php include on a website...for what its worth.
 

alisajid

Member
Jun 29, 2001
194
0
0
Use a <div> tag for netscape or an <iframe> for IE with a little browser sniffing script that will spit out the appropriate tag.
 

coomarlin

Senior member
Dec 19, 2000
796
0
71
Now I've been informed that my webserver does support SSI. But I tried some includes and couldn't get them to work.

I tried <!--#include file="footer.htm" --> but it just shows up blank in the webpage. I made sure the webpage had a .shtml ending but I just couldn't get it. Any clues?

PS. The "footer.htm" file is located in the same directory as my web space.
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
you can use javascript, although this is not a direct approach:

in your html file, wherever you want to put the copyright text, put this:
<SCRIPT SRC="filename.js" TYPE="Text/JavaScript">
<!--
// -->
</SCRIPT>

then, for the contents of the file "filename.js", you can put this:
document.write ("whatever you want to write to the page");

you can change the contents of "filename.js" to write whatever you want...
don't forget that this won't work if the user's browser has javascript turned off

there are easier ways to do this, but my brain just can't think right now ... will post when it does

alisajid: can you give us more info on your approach?

-948-

edit: missed some stuffs