![]() |
One way to do this is with Server Side Includes (SSI). SSI's are an easy way to add or update content to one or more web pages on a site. One way I use SSI's is for the copyright on my pages. By changing the year in one file, it changes the year on all of my pages. I also use SSI's for the links on my pages. If I decide to add or remove a link, or rearrange them, I simply make the changes in one file and my entire site is automatically updated. As I said before, make it easy. Why should I go to each of the 80 plus pages on my site to change something when I can do the same thing with one little file?
Another great thing about SSI's is that you can't see them on a web page. If you, or anyone, view the contents of your page, the SSI won't show. Instead, you will only see the HTML put there by the SSI.
Before you try to use SSI's you need to check with your web host to see if the server is set up for them. Most servers are. If they say they are, then you need to do a little test. Create a web page with the following HTML.
<HTML>
<TITLE>Testing SSI</TITLE>
<!--#config timefmt="%A" -->
<!--#echo var="DATE_LOCAL" -->
</HTML>Save this as an HTML file and upload it to your server. Now try to open the page with your browser. If you see the current weekday, like Monday, Tuesday, etc. then you can start using SSI's. If you don't see anything, rename the file extension. Instead of using HTML use SHTML. Some servers require the "S" and others don't.
Another thing you need to know is that you shouldn't use the SHTML extension on your Home or Index page. Spiders don't like it and won't be able to Index the page on their search engines.
Now that you know your server will let you use SSI's, let's start saving time. The first thing you need to do is create a text (.TXT) file that contains the information you want to include. This can be graphics, text, links or anything else you want to include. You will want to include the HTML that you would normally put on a web page. Think of this text file as something that will be pasted into your web page, since this is exactly what will happen.
If you wanted to include a copyright on each page, then put this into the text file
<p align="center">Copyright © 2004 Jeff Colburn</p>and save it as a text file. Let's call it copyright.txt.
Now, create the web page where you want the copyright to go. In the place where you want to see the copyright, put
<!--#include virtual="copyright.txt"-->then upload this web page to your server. When you go to this page with your browser, you will see the copyright information where you want it.
If the copyright doesn't show up, recheck the above command. Be sure the spacing and capitalization are correct.
I usually put these text files in my main folder with all the SHTML files. Another option is to put all of the SSI text files into their own folder. If you do that, then the command will look like this
<!--#include virtual="/directory/copyright.txt"-->Replace the word "directory" with the name of the directory where your text files are located.
Now you can use SSI's to include anything you want on various pages. And feel free to include as many SSI's on a web page as you want. I use up to five on some of my pages. The real secret is to carefully plan out your site and its future growth. This way you can include SSI's as you create your site, instead of adding them to your site after it's completed.
So have fun with SSI's, be creative and let your server do as much of your work as possible.
Related Articles
- A Beginners Guide to Server Side IncludesWhile much has been written about Server Side Includes (SSIs -also known as Virtual Includes) much of this information is designed for intermediate to advanced webmasters. This article is aimed at beginners...
- Server Side IncludesThis very helpful tutorial makes it much easier to make changes throughout your entire website. It is easy to follow and has plenty of code.
- Using SSI's To Ease Site MaintenanceBefore building a site, every webmaster has to make a decision on what layout method to use. Most seem to go with either a frame or a table-based layout, the latter being more popular in these days. While both of these have their advantages and disadvantages, a frame-based site is usually easier ...
- How To Easily Create A Search-Engine Friendly Navigation Menu For Your WebsiteA navigation menu is an important element of a website. A good navigation menu helps your visitors navigate through your website efficiently - in as few mouse-clicks as possible.
- ASP : Server Side IncludesThis tutorial was written by one of the great guys at HTMLForums. I read through this tutorial myself and found it to be very useful and easy to understand.
- Update Your Site Instantly With SSIThere are probably two main ways you currently update your site. The first, and most important, is adding new content. Whether you are updating a calendar, adding a new page, or putting in a photo of a new product, you are enhancing the value of your site for your visitors. The second, and more t...
- Take This Blog And...Youve decided your company will start a blog. Youve developed a strategy, picked and configured a platform, set a few general goals and put someone in charge. You are off to a great start.
- Client Side ScriptingHowever, this is not to say that other technologies are not extremely useful. Several technologies have proven to be just as important as CGI for the average Internet developer. These technologies focus on putting the demands of computation in the hands of the client instead of the server...
- 4 Powerful Features of Javascript Programming LanguageIn the community of web developers and surfers, Javascript is highly popular as client side scripting language for web browsers. Lets take a look at some of the features of this language.
- PHP Server to Client with No RefreshAlthough most of our companies work is template based design, the end result is always unique and adapts to each clients individual needs.

