Guide Categories:  Home | Drivers | Web Development | Hardware | Internet | Q & A | Tips & Tricks | Write
Web Development Silicon Guide
Search SiliconGuide:

Site Services:
Log In
Sign Up

Guides:
Getting Sponsored
Using SSI

#!/usr/bin/perl print < end

#!/usr/bin/perl $random = int(rand(10)); #$random = 10; if ($ENV{'REQUEST_URI'} eq "/qa/forum/messages/259.shtml") { print <
Older printer drivers are always hard to find. How about the ink cartridges for them? Dell ink is the hardest to find. Printer ink for the older machines can be easy to find if you know right where to look. Shop around to find the best deals on inkjet and toner cartridges.
end } elsif ($ENV{'REQUEST_URI'} eq "/tips/win95/office/office.shtml") { print <
Need a place for your Internet mail? Then Exchange email outsourcing is the way to go! No hassles, no coding experience, very little microsoft exchange server experience required at all.
end } elsif ($ENV{'REQUEST_URI'} eq "/internet/napster/4.shtml") { print <
Looking for mp3 players? Need a place to share your music. If you compare prices on some of the top MP3 players, you will notice that they are very inexpensive. Price comparison can be very beneficial to you.
end } elsif ($ENV{'REQUEST_URI'} eq "/qa/forum/messages/975.shtml") { print <
When designing pets in Sims, you may remember that you need pet supplies for your real pet. As much as its just a game, your real pet needs some lovin' right now. Go buy them a Pet Bed, and or teach your Dog some tricks.
end } elsif ($random eq -1) { print < end } elsif ($random eq -2) { @siliconmail_banners=("mail1.gif","mail2.gif","mail3.gif","mail4.gif","mail5.gif"); $ran2 = int(rand(5)); print < Silicon Mail end } elsif (($random >= 0) && ($random <= 7)) { print < end } elsif (($random > 7) && ($random <= 8)) { print < end } else { print < end } #print < #
# #end

The Silicon Guide To
Using Server Side Includes

Introduction

Anyone who attempts to build a web site will quickly notice how tiring it can be to maintain it, especially when there are hundreds of pages.   For instance, if you choose to have a menu bar, you will have to edit every single page on your site, every time you choose to modify it.  It can also become frustrating to find out you forgot to modify that "Last Modified" message you decided to post at the bottom of every page on your site.

Using Server Side Includes greatly reduces the amount of labour required to maintain a site.  But what are they?  SSI's are simply comments that you can insert into your HTML code.  When the server reads your html page, before sending it to the client's browser, it will check every line of it and "parse" any SSI comments it may find, replacing them with their appropriate content.  Since they are nothing more then comments, if your server does not have Server Side Includes enabled, or doesn't support them, your page will appear as it should, except without the SSI content you may have included, and no error will be displayed.

It is also important to take note that in the world of computer's, as in the real world, nothing is free.  Since the server has to read through every single page, and check to see if their are SSI commands (comments), having SSI enabled can dramatically increase the strain on your server and even slow it down noticeably.  For this reason, you should not use too many SSI commands in your pages (definetly not more than 20 per parge), as well as make sure your server is powerful enough to handle the traffic your plan to have.

Because of this, many server administrators have set up their web software only to parse pages with a certain extension; most often .shtml or .shtm.  This way the server only has to process those pages that actually use Server Side Includes.

Next Page:
The Echo Command
Skip Ahead:
The Config Command
Including files
Executing CGI Scripts
SSI Hosting and Conclusion

Home | Web Development | Hardware and Upgrading | Internet | Technical Questions & Answers | Tips and Tricks | Write to Us

Last modified on: Tuesday, October 15 2002 at 04:43 PM - UTC
Copyright © 1999 - 2012 SiliconPharm Corporation, All Rights Reserved
Powered by Apache/2.4.54 (Debian) (More Info)