469,927 Members | 1,887 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

How to 'INCLUDE' an ASP file?

Hello,
How to include file into an ASP program? I was trying with this command:

<!-#include file="INC_file.asp" ->

but unfortunately it does not work :(

There isn't any error message. IIS server shows primary site, but without
informations from incuded file.

How can I make it works?

With the best Regards,
MEMENTO

:)
Nov 7 '05 #1
8 1864
"memento" <me********@gazeta.pl> wrote in message
news:dk**********@inews.gazeta.pl...
Hello,
How to include file into an ASP program? I was trying with this command:

<!-#include file="INC_file.asp" ->


Use double dashes:

<!-- #include file="INC_file.asp" -->
Nov 7 '05 #2
And you can use include files also

<!-- #include virtual="header.inc" -->

---
http://www.KeepTrackOfIt.com - Find the lowest gas prices in your area
graphically

Nov 8 '05 #3
The problem was with the lack of a double hyphen, not this. But for the
record, there is no advantage to using a .inc extension, and plenty of
disadvantages. The main one is security. A person who's up to no good can
figure out the name of the .inc file, and then download it and read the
text. With an asp extension, this cannot be done.

Believe it or not, I've actually seen an application which had the database
login info, including password, in an include file with a .inc extension.

"KeepTrackOfIt.com" <in**@keeptrackofit.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
And you can use include files also

<!-- #include virtual="header.inc" -->

---
http://www.KeepTrackOfIt.com - Find the lowest gas prices in your area
graphically

Nov 8 '05 #4
M P
Is this true? Does include file be seen on the browser cache? How do you see
these files?

"middletree" <mi********@verywarmmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
The problem was with the lack of a double hyphen, not this. But for the
record, there is no advantage to using a .inc extension, and plenty of
disadvantages. The main one is security. A person who's up to no good can
figure out the name of the .inc file, and then download it and read the
text. With an asp extension, this cannot be done.

Believe it or not, I've actually seen an application which had the
database login info, including password, in an include file with a .inc
extension.

"KeepTrackOfIt.com" <in**@keeptrackofit.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
And you can use include files also

<!-- #include virtual="header.inc" -->

---
http://www.KeepTrackOfIt.com - Find the lowest gas prices in your area
graphically


Nov 9 '05 #5
I've never seen them in a browser cache, but middletree is right. I
didn't recommend it, I was just saying it was an option.

More info here:

http://www.w3schools.com/asp/asp_incfiles.asp

---
http://www.KeepTrackOfIt.com - Find the lowest gas prices in your area
graphically

Nov 9 '05 #6
What middletree meant IMO is that if you take an improper name for an
include file such as "tools.txt" then someone trying this URL would get the
file... As ASP files are processed it offers quite a kind of protection (for
example a .asp include file that contains only functions and subs would just
produce an empty HTML page client side when served).

--
Patrice

"M P" <ma**@textguru.ph> a écrit dans le message de
news:%2****************@TK2MSFTNGP14.phx.gbl...
Is this true? Does include file be seen on the browser cache? How do you see these files?

"middletree" <mi********@verywarmmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
The problem was with the lack of a double hyphen, not this. But for the
record, there is no advantage to using a .inc extension, and plenty of
disadvantages. The main one is security. A person who's up to no good can figure out the name of the .inc file, and then download it and read the
text. With an asp extension, this cannot be done.

Believe it or not, I've actually seen an application which had the
database login info, including password, in an include file with a .inc
extension.

"KeepTrackOfIt.com" <in**@keeptrackofit.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
And you can use include files also

<!-- #include virtual="header.inc" -->

---
http://www.KeepTrackOfIt.com - Find the lowest gas prices in your area
graphically



Nov 9 '05 #7
You misunderstood his point. Server-side includes (SSI) will never show up
in a browser cache. Only client-side includes:
<script src="...">

What he is saying is, that if you use an easily-guessable name for your
include file, say: scriptlibrary.inc somebody will be able to browse to it
by typing its address in the browser's address bar. Since the inc extension
is not mapped to be executable (by default, this is configurable), the text
in the page will be shown in the browser. Try it with your own inc file. By
changing the inc extension to asp, you prevent this: when the file is
browsed to, it is executed, not displayed.

Bob Barrows

M P wrote:
Is this true? Does include file be seen on the browser cache? How do
you see these files?

"middletree" <mi********@verywarmmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
The problem was with the lack of a double hyphen, not this. But for
the record, there is no advantage to using a .inc extension, and
plenty of disadvantages. The main one is security. A person who's up
to no good can figure out the name of the .inc file, and then
download it and read the text. With an asp extension, this cannot be
done. Believe it or not, I've actually seen an application which had the
database login info, including password, in an include file with a
.inc extension.

"KeepTrackOfIt.com" <in**@keeptrackofit.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
And you can use include files also

<!-- #include virtual="header.inc" -->

---
http://www.KeepTrackOfIt.com - Find the lowest gas prices in your
area graphically


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Nov 9 '05 #8

http://www.powerasp.com/content/code...s/includes.asp

"memento" <me********@gazeta.pl> wrote in message
news:dk**********@inews.gazeta.pl...
Hello,
How to include file into an ASP program? I was trying with this command:

<!-#include file="INC_file.asp" ->

but unfortunately it does not work :(

There isn't any error message. IIS server shows primary site, but without
informations from incuded file.

How can I make it works?

With the best Regards,
MEMENTO

:)

Dec 4 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by wukexin | last post: by
28 posts views Thread by Ramesh | last post: by
60 posts views Thread by Derrick Coetzee | last post: by
9 posts views Thread by bill | last post: by
12 posts views Thread by Francois Grieu | last post: by
9 posts views Thread by zolli | last post: by
5 posts views Thread by David Mathog | last post: by
6 posts views Thread by tshad | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.