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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSI in ASP

Status
Not open for further replies.

fatmbk

Technical User
Jul 11, 2002
29
0
0
GB
I have read about SSI (Server Side Includes) and I want to know how i can use them. Am i right in thinking that they enable a programmer to write a block of code and then store it within an include file, then that include file is included in any pages you require that code in?

My overall aim is to store the code for connecting to a database within one file, and then just to be able to call the code from that one file in each of my ASP pages.

Any ideas?

Fatmbk
 
you would use something like this

<!--#include file="codeblocks.asp"-->
 
then just store all you variables, functions, connection string within the codeblocks.asp page
 
also depending if you server has parent paths enabled you might have to use

<!--#include virtual="codeblocks.asp"-->
 
you don't but if you do have parent paths enabled you have to, and you can't use ..file=...
 
Though, imo, the glgbal.asa is a better place to store connection strings. With the include, they're being repeated on every page. If you put them in your global.asa you can refer to the variable on every page but not repeat the processing.

(Mind you, I use includes for a variety of things, but not that type of thing.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top