Customer Login  .   Webmail Login  .   About Us  .   Contact Us
Go to: Articles List

Code Smarter Part 2 : Use Include Files

Along with encapsulating your code, the next best thing to do with this code is to place it in a file and include it. You can place all of your commonly used code in one simple file and include it.

There are two types of includes: virtual and absolute. Each is demonstrated below:

Virtual:
<!-- #include virtual="/includes/common.asp" -->

Absolute:
<!-- #include file="d:\inetpub\wwwroot\includes\common.asp" -->

Which is better? The virtual in my opinion. The reason I chose and always use virtual includes myself is because if I move that file to another website or web server the path will generally stay the same. Whereas if I were to use an absolute include file I might have to go change the drive letter and file structure.

Remember to place this code outside of the ASP script blocks.

Shared Hosting
Rookie
Pro
Advanced
Dedicated Servers
BASE
BUSINESS
ENTERPRISE
Why Choose Brinkster?
Radical Support
Brinkster Datacenter
Brinkster Network
Corporate Social Responsibility
90 Day Money Back Guarantee
Unsurpassed Value
Client Testimonials
Additional Features
Antivirus
Merchant Account
E-Commerce
Live Chat Communicator
Free Firewall
Website Builder
Free Web Hosting
Support
General Support
Codebank Search
Forums
Articles
Click here for Brinkster Live Chat
Home   Domains   Shared Hosting   Dedicated Hosting   Partner   Support   About Us    Contact Us   Webmail
Copyright © Brinkster Communications Corporation All Rights Reserved. Privacy Policy & Legal