I'm trying to put an include file in my htm document. Now when I turn the document to .asp it works... can I even do an insert file in an htm document? I've tried changing the include file extention to .htm to see if that helped, it didn't.<br />
<br />
Here's my include:<br />
<td valign=top align=center><form name="nav"> <!-- #include file="dropdown.inc" --></form></td><br />
<br />
And here's the text in it:<br />
dropdown.inc<br />
<font face=arial size=-1 color=black><B>Browse the Site:</B> <select name=choose onchange="navigate()"><br />
<option selected>Make Selection below..</option><br />
<option>History</option><br />
<option>Activities</option><br />
<option>Administration</option><br />
</select><br />
<br />
Now this include works in the same document:<br />
<!-- #include file="footer.inc"--><br />
<br />
here's the text in the include:<br />
<p><table align=center border=0 width=95%><tr><td align=center><a href=http://www.webdeveloper.com/forum/archive/index.php/"../../"><img src="images/cclogo.gif" border=0 alt="homepage"><BR>Homepage</a></td><td align=center><a href="default.htm"><img src="images/img002.gif" border=0 alt="homepage"><br>Office Homepage</a></td></tr></table><br />
</td><!--content-->faiyth<br />
<!-- #include file="dropdown.inc" --><br />
<br />
Is this copied exactly from your page? There should be no space before the hash mark, you should use virtual instead of file, and the extension of the page should be .shtml<br />
<br />
page.shtml<br />
<!--#include virtual="dropdown.inc" --><!--content-->Originally posted by jeffmott <br />
you should use virtual instead of file, and the extension of the page should be .shtml<br />
<br />
Please confirm this:<br />
<br />
use virtual if you want to say from any location in your directory tree (so it starts in the root):<br />
<--#include virtual="/mapname/file.ext --> <br />
and use 'file' if you want to navigate from the position you are now:<br />
<--#include file="../..//mapname/file.ext --> <br />
<br />
Right?<br />
<br />
Next: Will everything in a include file be placed in the file where you place the include? So, if I place this in file A:<br />
<!-- #include file="../fileB.inc" --> <br />
Will everything inside fileB be placed inside file A?<br />
<br />
Where can I find more information about the includes (other than this forum)<br />
<br />
Thanks for all your help,<br />
<br />
JayDie<!--content-->Here's a page about using includes.<br />
<br />
<!-- m --><a class="postlink" href="http://www.smartwebby.com/web_site_design/server_side_includes.asp">http://www.smartwebby.com/web_site_desi ... cludes.asp</a><!-- m --> <br />
<br />
As stated in the linked tutorial that .htm or .html files won't work. They need to be .asp or .shtml files. Also, as a matter of security (if you're using ASP), don't use .inc for your include file as they can be hacked. Just use .asp file extension.<br />
<br />
And yes, everything in the include B file is placed into file A.<br />
<br />
Hope this helps<!--content-->Thanks a lot!<br />
<br />
JayDie<!--content-->
<br />
Here's my include:<br />
<td valign=top align=center><form name="nav"> <!-- #include file="dropdown.inc" --></form></td><br />
<br />
And here's the text in it:<br />
dropdown.inc<br />
<font face=arial size=-1 color=black><B>Browse the Site:</B> <select name=choose onchange="navigate()"><br />
<option selected>Make Selection below..</option><br />
<option>History</option><br />
<option>Activities</option><br />
<option>Administration</option><br />
</select><br />
<br />
Now this include works in the same document:<br />
<!-- #include file="footer.inc"--><br />
<br />
here's the text in the include:<br />
<p><table align=center border=0 width=95%><tr><td align=center><a href=http://www.webdeveloper.com/forum/archive/index.php/"../../"><img src="images/cclogo.gif" border=0 alt="homepage"><BR>Homepage</a></td><td align=center><a href="default.htm"><img src="images/img002.gif" border=0 alt="homepage"><br>Office Homepage</a></td></tr></table><br />
</td><!--content-->faiyth<br />
<!-- #include file="dropdown.inc" --><br />
<br />
Is this copied exactly from your page? There should be no space before the hash mark, you should use virtual instead of file, and the extension of the page should be .shtml<br />
<br />
page.shtml<br />
<!--#include virtual="dropdown.inc" --><!--content-->Originally posted by jeffmott <br />
you should use virtual instead of file, and the extension of the page should be .shtml<br />
<br />
Please confirm this:<br />
<br />
use virtual if you want to say from any location in your directory tree (so it starts in the root):<br />
<--#include virtual="/mapname/file.ext --> <br />
and use 'file' if you want to navigate from the position you are now:<br />
<--#include file="../..//mapname/file.ext --> <br />
<br />
Right?<br />
<br />
Next: Will everything in a include file be placed in the file where you place the include? So, if I place this in file A:<br />
<!-- #include file="../fileB.inc" --> <br />
Will everything inside fileB be placed inside file A?<br />
<br />
Where can I find more information about the includes (other than this forum)<br />
<br />
Thanks for all your help,<br />
<br />
JayDie<!--content-->Here's a page about using includes.<br />
<br />
<!-- m --><a class="postlink" href="http://www.smartwebby.com/web_site_design/server_side_includes.asp">http://www.smartwebby.com/web_site_desi ... cludes.asp</a><!-- m --> <br />
<br />
As stated in the linked tutorial that .htm or .html files won't work. They need to be .asp or .shtml files. Also, as a matter of security (if you're using ASP), don't use .inc for your include file as they can be hacked. Just use .asp file extension.<br />
<br />
And yes, everything in the include B file is placed into file A.<br />
<br />
Hope this helps<!--content-->Thanks a lot!<br />
<br />
JayDie<!--content-->