/    Sign up×
Community /Pin to ProfileBookmark

Problem with Include File

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.

Here’s my include:
<td valign=top align=center><form name=”nav”> <!– #include file=”dropdown.inc” –></form></td>

And here’s the text in it:
dropdown.inc
<font face=arial size=-1 color=black><B>Browse the Site:</B> <select name=choose onchange=”navigate()”>
<option selected>Make Selection below..</option>
<option>History</option>
<option>Activities</option>
<option>Administration</option>
</select>

Now this include works in the same document:
<!– #include file=”footer.inc”–>

here’s the text in the include:
<p><table align=center border=0 width=95%><tr><td align=center><a href=”../../”><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>
</td>

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@jeffmottDec 30.2002 — [i]faiyth[/i]

[b]<!-- #include file="dropdown.inc" -->[/b][/quote]


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

page.shtml

[font=courier new]<!--#include virtual="dropdown.inc" -->[/font]
Copy linkTweet thisAlerts:
@JayDieApr 15.2004 — [i]Originally posted by jeffmott [/i]

[B]you should use virtual instead of file, and the extension of the page should be .shtml[/B][/QUOTE]


Please confirm this:

use virtual if you want to say from any location in your directory tree (so it starts in the root):

[FONT=courier new]<--#include virtual="/mapname/file.ext -->[/FONT]

and use 'file' if you want to navigate from the position you are now:

[FONT=courier new]<--#include file="../..//mapname/file.ext -->[/FONT]

Right?

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:

[FONT=courier new]<!-- #include file="../fileB.inc" -->[/FONT]

Will everything inside fileB be placed inside file A?

Where can I find more information about the includes (other than this forum)

Thanks for all your help,

JayDie
Copy linkTweet thisAlerts:
@zingmatterApr 15.2004 — Here's a page about using includes.

[URL=http://www.smartwebby.com/web_site_design/server_side_includes.asp]http://www.smartwebby.com/web_site_design/server_side_includes.asp[/URL]

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.

And yes, everything in the include B file is placed into file A.

Hope this helps
Copy linkTweet thisAlerts:
@JayDieApr 16.2004 — Thanks a lot!

JayDie
×

Success!

Help @faiyth spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...