BigNoseBird.Com- Home Small Logo
The 508 Compliant Guide to 
       Big Nose Bird
BACK

The INCLUDE Directive:
The Include in
Server Side Includes!

Originally, this was the idea behind server side includes- being able to well, umh, include or copy files into a document. Think of it as being sort of like a document merge in word processing.

Please take a moment to view the lower and side parts of this page. In the actual source code shtml file, everything after

You will now have a directory entry in the document directory and your include should work just fine!
does not exist in the document file. Instead, all that is there are the following lines:

<!--#include file="mailform1.txt" -->

View mailform1.txt Please note that some browsers may show formatted output. If this occurs please select VIEW-SOURCE from your browser's menu bar.

This SSI directive allows us to easily update the navigation bar and fine print statement on any page that includes the directive. To change any page, we need only edit the mailform1.txt file. That is a timesaver!

Including Files Outside Your Document Directory
For security reasons, many servers are configured not to allow you to copy in files located outside your webspace, or DocumentRoot. You can either copy the file to your document directory, or do this little trick:

The unix ln (link) command allows you to create a entry in a directory that points to a real file located elsewhere on the computer. If you have a file called myfile.txt located in /usr/me/mybookfiles/source you could do this:
cd public_html (or wherever your webpage is located)

ln -s /usr/me/mybookfiles/source/myfile.txt myfile.txt

You will now have a directory entry in the document directory and your include should work just fine!

If Your Files are Under Your DocumentRoot

If the file you want to include in your page is located some where under your DocumentRoot directory (the one with your main index page), you can use the virtual type of include:
<!--#include virtual="/file.txt" -->

   or

<!--#include virtual="/somedir/file.txt" -->

 


Find or Give Help on the BBS
 
Home Top E-Mail
If it looks great, it's by Christine
Some Fine Print
© 1997-2003 BigNoseBird.Com®, Inc. All rights reserved. All other trademarks are the sole property of their respective owners. The products that we recommend are only ones that we use. We have no relationship with any of the authors or their companies. We cannot assume responsibility for their ultimate performance or lack of same. We also cannot assume responsibility for either any programs provided here, or for any advice that is given since we have no control over what happens after our code or words leave this site. Always use prudent judgment in implementing any program- and always make a backup first! For further information, please read our Privacy Statement. We can be contacted at webmaster@bignosebird.com.


<reallybig.com>
Web Builder Network Portal
Advertise
on the
Reallybig.com
Network
BigNoseBird Newsletter
Subscribe
Un-Subscribe


Sign up today to receive our low volume newsletter. Tips, tricks, news, and whatever else crosses our minds.
Back Issues
Privacy Statement