A Beginners Guide To Server Side Includes
|
|
An Introduction to Server Side Includes
Beginner? That's OK!
While 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. It is assumed that the reader has no prior knowledge of scripting languages, servers, or any other advanced computer skills. This article will introduce the reader to SSIs and explain how they are used in web site development. SSIs are guaranteed to save you time as your web site develops and changes over time.
Servers: just a place for your stuff?
It is important to understand that all the code for your website is stored remotely on a computer called a server. On a very basic level, the server (remote computer) is just a place where you can store the files on the "net." These files would typically contain your web site's HTML code and possibly some files containing pictures or graphics.
For example, a very simple web site might consist of 5 web pages with five corresponding files that are stored on the server. One file is named index.html and we will have four additional files. These files might be named about-me.html , education.html , resume.html , and portfolio.html. We'll say that this simple 5 page web site is run by a freelancer who uses this site as a kind of virtual advertisement.
Servers Part 2: more than storage?
We have established that the server functions as a storage place for our files, but it is important to recognize servers can also do things. Similar to the operating systems software on our personal computers, servers have software that allows them to access and organize files. Servers can also carry out more advanced functions. Take, for example, what the server does when someone visits the root directory of your site; the server automatically loads your index page (e.g., index.html, index.php, index.asp). This is a very simple example of something that happens on the "server side."
Why do I need includes?
Now that we understand that remote servers have software on them capable of carrying out certain tasks, we can turn our attention to the "includes" portion of the equation. What are includes? Let's take our hypothetical web site that serves as an advertisement for our imaginary freelancer. Imagine that the freelancer designs a left hand navigation menu so that people can easily browse all five pages of his site. Therefore, each page of this site contains the code for the navigation bar. Imagine that a few months after launching this web site, our freelancer wants to add a Frequently Asked Questions page. Our freelancer now has to update the navigation bar code in each of his five existing pages. Now there are six pages with this same navigation bar code. A month later our freelancer wants to add a self-written article to his site. Once again every page on the site needs to be updated. Imagine having a site with 100's of pages. Do you want to manually update 100's of pages of code? These are the types of situations where virtual includes can save you hours of time.
What are we including on the server side?
Perhaps it would be better to think of includes as "modules" that we can insert into our web pages. These modules (or "includes") are usually just text files that contain HTML code (although they can be other file formats). The code inside these files can be inserted anywhere in a page simply by using an include command. For example, imagine for a moment that our freelancer had the foresight to realize that the navigation menu would change at some point in the future. Instead of putting the code for the navigation menu into each individual page, the freelancer placed this code into a separate file. For the sake of example, we can call this file nav-menu.html Our freelancer can now simply place an "include" command that refers to the nav-menu.html anywhere he/she wants to place this menu. The advantage of this is becomes apparent when our freelancer needs to modify the navigation menu. Just one file needs to be edited, nav-menu.html, and all the pages containing "include" refering to this file will automatically update themselves. This time savings is the primary advantage of using includes.
OK, I get it, but what does an include look like?
Even though this is not a "technical" article, many of you are probably wondering what an "include" looks like. Therefore, one example for PHP is included below. Please note PHP is just one type of scripting language that can be used, depending on what your server is running. In this example, the code contained in the file "nav-menu.html" will be inserted into any web page where the following code is placed:

Keep in mind that, for technical reasons, server side includes will never be visible when you view the source code for a page in your browser. This is because the include happens on the server (before presenting the resulting code to the browser). This makes the use of SSIs invisible to browsers, bots, spiders (which is why they are search engine friendly)
Summary
The catch-22 of server side includes is that the need for them only becomes apparent when faced with the task of updating tens or hundreds of pages of code. There are many resources on the web that will instruct you how use virtual includes, and procedures will vary depending on the type of scripting language supported by your server (e.g., ASP, PHP). Hopefully you now understand Server Side Includes and how they can benefit the webmaster.
About the authors:
This article was written by the editors of the Kabooli Internet Directory. This article may be used freely in opt-in publications and websites as long as the article not changed in any way and all links in the Authors section are active . A courtesy link to any online posting would be greatly appreciated and can be sent to the editors of the Kabooli Directory by using the Kabooli Internet Directory Contact Form
|
|
|
Created & Maintained by Empower! CMS Web Sites
Host2Sell Web Hosting | Emarketing Workshops | Site SEO Review | FREE NewsletterDreamweaver 8 Preview
August 8 2005, Macromedia announced a release of Studio 8. Based on the feedback of previous users, Macromedia made it's already very powerful software even better.Dreamweaver 8 improvements include: CSS panelWith the new CSS panel it is very easy to add, view and edit CSS styles.XML integrationIn Dreamweaver 8 you ...(related: Web Development)
Create Huge Income From Your Web Site - 10 Easy Ways
The cost of setting up a web site is dirt cheap nowadays. You can register a domain for less than $2.00 as I write this (for .info domains). Hosting is also very cheap, and getting cheaper all the time.So why are so many web sites springing up? Obviously somebody's making money besides the hosting companies, so here's some idea starters for you:1. Sell your own products or services. They should be related to your target audience. You want to be able to take credit cards (at least with PayPal if not otherwise) on your site and deliver your product to your customers as fast as possible.2. Sell another company's products. There is no shortage of companies w...(related: Web Development)
The Power Is In The Pipes: How To Get Maximum Leverage From Your Website
What is the most important part of your online business?Many people would say: "my website". And that'sunderstandable ? it's the most visible part of an in...(related: Web Development)
Web Measurement: What You Don?t Know Would Make A Great Book
"What's in it for me?" you ask. "Why should I measure how people use my website? How does it help and what does it all mean?" The purpose of this article is to try to give you some insight into effective web measurement and to talk...(related: Web Development)
How To Listen On The Web
When building a relationship, listening is more important than talking.A website can reveal a great...(related: Web Development)
Your Content For Nothing And Your Clicks For Free
The first thing my business consultant (read brother-in-law) asked me, when I told him that I wanted to build a website and put AdSense on it was, "Do you want to build a site to help people or to make money?" After thinking about it for a while I couldn't imagine why I shouldn't do both. Why not a website that helps pe...(related: Web Development)
The Secret Benefit Of Accessibility: Part 1 - Increased Usability
Web accessibility has so many benefits that I really do wonder why such a large number of websites have such diabolically bad accessibility. One of the main benefits is increased usability, which according to usability guru, Jakob Nielson, can increase the sales/conversion rate of a website by 100% and traffic by 150%.At which point you must surely be asking, "So if I make my website accessible its usability will increase and I'll make more money out of it?". Well, not quite. An accessible website is not automatically more usable but there are many areas of overlap:1. Descriptive link textVisually impaired web users can scan web pages by tabbing from link to link and listening to the content of the link text. As such, the link text in an accessible website must always be descri...(related: Web Development)
Why Your Business Needs A Website
Even with the steady growth of the World Wide Web, many businesses do not have an online presence and some think that they do not need to have a presence at all."My business is doing fine as it is." That's great! But, it's almost impossible to answer 'no' to the question, "Can my business be doing even better?" One of the easiest ways to help your business gain more exposure and potential customers is to have a profess...(related: Web Development)
Web Site Optimization: How To Speed Up Your Web Site By Minimizing Your Gif And Png Image Bit-depth
Are bloated images slowing down your web site and causing you lost business? Images comprise over 50% of the average web page so putting them on a diet is essential to improving web performance. One of the best ways to optimize GIFs and PNGs is to minimize the "bit-depth" or the number of colors within your images.For palette-based formats like GIF and PNG, file size is directly related to the size of the color palette, or the number of colors in the image. As the number of colors in an image crosses a power of two, the file size jumps. A 33-color image must use a six-bit palette, while a 32-color image can use a 5-bit palette. Smaller palettes mean smaller codes (representing pixel patterns), which makes for smaller files. So minimizing the number of colors in index-c...(related: Web Development)
Study Your Sites Performance Via Hit Tracking
Knowledge is power.And undoubtedly, it is the key to making a substantial fortune online. Consider these: what if you knew the sited your visitors came from before they arrived at yours, what they were checking out before they took a look at your pages, and where they went after visiting your place? What if you knew which of your links were being clicked, how much they were being used, and how well they are performing? What if you knew which among the pages in your site attracts the most attention?Again, knowledge is power and knowing all these things would lead to better results from your site.Thankfully, technology has caught up with this highly particular necessity. A lot of programs...(related: Web Development)
Websites For Writers ? Why You Need One And How To Get Started Today
It may seem like the publishing industry's equivalent of Beanie Baby madness- everyone is talking about writer's websites. Freelancers and authors everywhere are jumping on the bandwagon, publishing sites to promote themselves and their work. This craze leaves many writers wondering if it's just a fad or if it's really worth the expense and effort. While it may seem like an overwhelming or frivolous endeavor, there are some solid business reasons why you should consider setting up your own website.? Editors Like Writer's Websites. When querying an editor for the first time, you can add credibility to your writing resume by referencing your website. Instead of attaching clips, you can provide a link to clips on your site. This minimizes paperwork and lets you avoid sending email attachments that can get sc...(related: Web Development)
How To Draw Icons Or Images On A Mapserver Generated Map
In this example I have used the map of the Itasca demo of the Mapserver.I have done only small changes to the map file.The Itasca demo has (into the html file) the parameters of the path where to store the images:...(related: Web Development)
Making Your Website Shine! Attract And Keep Visitors At Your Site!
When you consider the billions of individuals and companies on the net who are attempting to influence visitors with their wares, it is vitally important that your site offers something out of the ordinary. An important fact to remember is that what the site says is far more important than how it looks. Why? Because good copy sells!Pretty is as Pretty Does!I don't mean to imply that a beautiful site isn't going to attract visitors, but pretty is as pretty does! What happens once visitors get to your site? Your potential prospects will surely appreciate an entertaining and good-looking web site but they didn't necessarily come by to be dazzled by the design. They came because they were looking for your product or service. So be sure your site is conveying an enthusiastic message about your business.Content must be ...(related: Web Development)
site-map - Copyright © 2006 Empower! Web Design | All Rights Reserved. | Web Development
