Learnthat.com Free Certification and Computer Online Courses
ThatNetwork.com Internet Media Network Givethat.com free gift ideas Definethat.com - Free technical definitions, define Free Romance Tips, Romantic Tips, Date Ideas Free POD publisher comparison print on demand
Learnthat.com Free A+ Certification, Computer Classes, Certification Courses, Business, Lifestyle, ApplicationsFree business tutorials and definitionsFree certification tutorials and definitionsFree computer and technical tutorials and technical definitionsFree Finance Tutorials and DefinitionsFree House Repair TutorialsFree Lifestyle and Fun Tutorials
  All Online CoursesNew Courses QuickTipsWord DefinitionsSubmit a TutorialLinks
÷ Resources
Home
free tech tutorials
Free Tutorials
free tech tutorials
Certifications
free tech tutorials
Definitions
free tech tutorials
Resources/Links
free tech tutorials
Forums
free tech tutorials
Distance Education
free tech tutorials
Highest Rated Tutorials
÷ Popular Tutorials
÷ New Tutorials

Active Server Pages (ASP)

 

Server Side Includes (SSIs)

Server Side Includes are references in ASP pages to files containing reusable chunks of code. These files can contain HTML or ASP, and are saved with the extension .inc. The following example demonstrates a file containing a database connection that will be reused in multiple pages in an application:

<%

Public cnn, cnnstr, rst

Public folder, path

Public sql, cnt, i, msg

Public Function InitDB()

folder=Server.MapPath("/Documents/docs.mdb")

set cnn=createobject("adodb.connection")

set rst=createobject("adodb.recordset")

cnnstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & Server.MapPath("/Documents/docs.mdb")

With Cnn

    .Mode = adModeReadWrite

    .Mode = adModeShareDenyNone

    .CursorLocation = 3

    .ConnectionString = cnnstr

    .open

End With

End Function

%>

The physical path to the file is then included in the various ASP pages using the #include file statement enclosed in comment tags:

<!--#include file="Connections\data.inc" -->

<HTML>

<HEAD>

</HEAD>

<BODY>

</BODY>

</HTML>

You can use the VIRTUAL keyword to include a file contained in a virtual directory outside the directory structure of the application:

<!--#include virtual="IncludeFiles/data.inc" -->

<HTML>

<HEAD>

</HEAD>

<BODY>

</BODY>

</HTML>

 

 

by Summer Doucet

Find more free Internet tutorials from Learnthat.com.

More Information:

Help us by rating this tutorial: [---] [--] [+] [++] [+++]
[---] lowest; [+++] highest

 

 

 


Learn: Free Tutorials - Links to Free Tutorials
Understand: Free Technical Definitions - ExplainThat Whitepapers
Use: Certification Section - Discussion Forum

Visit Our Network Sites:

DefineThat.com Technical Defintions Romancetips.com
Free Gift Ideas - GiveThat Planthat.com Free Unique Business Ideas
PublishOnDemand.net - Learn about Print on Demand (POD) - Self Publishing Seekthat.com - Technical Search Engine
ThatNetwork.com  

About Us : Contact Us : Advertise : Privacy Information

© 1998-2004 Learnthat.com