Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

#include problem

Status
Not open for further replies.

mihalych

Programmer
Jul 24, 2003
27
US
I have a problem with #include statement. I want to include one HTML(.htm) file into another one but it doesn't work.
For example:

<<Main.htm>>

<HTML>
<HEAD>
<TITLE>Main.htm</TITLE>
</HEAD>
<BODY>
<!--#include file=&quot;inc.htm&quot; -->


</BODY>
</HTML>

and

<<inc.htm>>

<tr>
<td>test</td>
</tr>

These files are in the same directory.
But it doesn't display anything. What I did wrong?
 
Sorry - includes only work with asp pages....

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
Change the filename of the file to .shtml

mwolf00,

The above include statement is an SSI directive, it works in ASP as well but it is in no way limited to ASP.

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
Thanks wullie

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
Create a .htaccess file containing the following....
Options +Includes
AddType text/html .html .htm
AddHandler server-parsed .html .htm



That way you wont have to rename your page to .shtml
 
farley99,

Please read the following FAQ before you give this advice.

For a start, you have no knowledge of what type of server this is running on, whether there is any need to keep a html extension or whether this will affect the whole setup or not.

faq65-1948

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top