Forum Moderators: open

Message Too Old, No Replies

html include

         

natty

3:13 pm on Oct 11, 2004 (gmt 0)

10+ Year Member



hi all,

i did search on here, but no luck..
simply want to include another html file in another..
idea being thatif i change the menu, which is the included bit, i wont have to fiddle with 20 pages..

i tried
<!--# include virtual="menu.htm" -->

and

<!--# include href="menu.htm" -->

obviously im doing somethign wrong..
maybe its that i cant do it this way..

?
tia

MozMan

3:28 pm on Oct 11, 2004 (gmt 0)

10+ Year Member



At first glance, I think it is simply a matter of removing the space after the pound sign. You might also want to put a slash in the url:

<!--#include virtual="/menu.htm" -->

-Moz

topr8

3:37 pm on Oct 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



try

<!--# include FILE="menu.htm" -->

or

<!--# include VIRTUAL="/menu.htm" --> full path to root required

natty

3:55 pm on Oct 11, 2004 (gmt 0)

10+ Year Member



sorry chaps, but none of those worked..

maybe its a server thing..

cheers anyhow..

unless you know the IIS setting..

tia

vkaryl

4:09 pm on Oct 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe try changing the page extension to .php from .htm/.html (so you'd have mainpage.php or whatever), and use <?php include 'menu.htm'?> etc. Though would that work on IIS? I don't have any background in that at all....

jk3210

4:37 pm on Oct 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Doesn't a server have to be set-up to process includes before you can use them?

tedster

4:49 pm on Oct 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's a Microsoft reference:

IIS Server Side Includes Directive [msdn.microsoft.com]

Lance

5:07 pm on Oct 11, 2004 (gmt 0)

10+ Year Member



It's the spaces, like MozMan said. You MUST remove the space after the # sign.

<!-- #include file="SomeFile.html" -->
<!-- #include virtual="/SomeFile.html" -->

And if the includING (not included) file is a .htm(l) file, shange the extension to .shtm(l)