/    Sign up×
Community /Pin to ProfileBookmark

Hi,

have used this <!–#include file=”includes/myfile.txt” –> in my html page, i see it in dreamweaver, but not on the published page ?

Have also used <!–#include virtual=”includes/myfile.txt” –>, same thing , not seen on published page?

Regards

to post a comment
HTML

6 Comments(s)

Copy linkTweet thisAlerts:
@BonRougeNov 27.2004 — What is the question exactly?

You're right - you don't see it on the page you receive. The point of it is that the server replaces it with the text that you asked it to put in before it reaches the browser.
Copy linkTweet thisAlerts:
@toicontienNov 27.2004 — The <!-- #include --> statement is for Server Side Includes. You'll need Server Side Includes, or SSI, enabled on your Web server, then you'll also need HTML files named with the .shtml or .shtm file extensions for SSI to work.

In other words, the HTML file you want to use to include other files should be named something.shtm or something.shtml. Then in that file, you'll have <!-- #include file="path/to/file.txt" -->.

You can pass variable-value pairs in a URL to a server side script using <!-- #include virtual="path/to/script.php?variable=value" -->
Copy linkTweet thisAlerts:
@summyNov 28.2004 — Also try

<!--#include file="includesmyfile.txt" -->

instead of

<!--#include file="includes/myfile.txt" -->
Copy linkTweet thisAlerts:
@toicontienNov 29.2004 — The backslash probably won't work. Since early Web servers were all Unix-based, the forward-slash was used for file paths in URLs. Windows servers inherited that functionality, so the forward slash is still the correct character to use to separate folder names. First do the things I mentioned in my first post. Then write back if that doesn't work.
Copy linkTweet thisAlerts:
@Hammer65Nov 29.2004 — If you must do this client side reformat to make your text a .js file with the text assigned to a variable that you can then use with document.write() to write into the page while it's loading. HTML doesn't really have any other way to include files besides js and css documents.
Copy linkTweet thisAlerts:
@toicontienNov 29.2004 — Use the JavaScript method as a last resort. Between 5 and 10 percent of Web surfers have JS disabled (depending on who you ask). Also, search engines won't read your JavaScript. If the content that gets written with JavaScript is part of your main content, definitely go the Server Side Includes route because the browser (and search engine) gets a complete HTML document, no matter how many files were included using SSI.
×

Success!

Help @frutibeard 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.19,
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,
)...