August Wind Enterprises

New-->Using DatePart and other Date Functions
New-->Understanding Includes
(Updated) Using Single & DoubleQuotes in ASP with SQL Statements
(Updated) Emailing Form Results
Mass Emailing with CDO
Using The Ad Rotator
ASCII Character Set 0-127
Include - Basic
Understanding Include Statements

Many people find include files very confusing, as I once did when I started learning ASP. To start out understanding this concept, really the only things you need to understand are general file/folder structure and the fact that, when IIS (the web server that comes and is most often used with NT) is installed, by default, it installs it, in a structure resembling the following :
Drive Letter :\inetpub\wwwroot. This is the 'Web Root' of your web site.

An include file must have a relative path - you must list it as a path relative to where its parent ASP document is. If it is in the same directory -

<!-- #include file="security.inc" --> 
If it is in the security folder beneath that directory -
<!-- #include file="security/security.inc" --> 
If it is in a folder above it -
<!-- #include file="../security.inc" --> 
(and yes, I've used this and it works)

Otherwise - use Include Virtual - it works from the Web Root, so if your ASP is in C:\Inetpub\wwwroot\user\project\security.inc, you start from the Web Root, which is Inetpub\wwwroot -

<!-- #include virtual="/user/project/security.inc" -->
This should clear things up a little bit, I hope. By the way - there is an easy 'Include File Assistant' which has been a native feature in ASP Express since it's inception. Click here to find out more about ASP Express.

Back to the Top | AugustWind Home

Please, email your questions or comments to : (questions@augustwind.com)
Last Updated 2/22/2011 10:02:28 PM © 2018 August Wind Enterprises - All rights reserved