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

Web Coach Tip: What You Should Know About DIY Web Sites

Recently, a friend asked "What's the deal with those DIY companies that advertise "How to... Read More

Why Your Business Needs a Website

Even with the steady growth of the World Wide Web, many businesses do not have... Read More

Creating Compelling Content , Write It and They Will Come

In a previous ezinearticles.com article,"I Need real visitors, Not Search Spiders" we discussed the need... Read More

How to Listen on the Web

When building a relationship, listening is more important than talking.A website can reveal a great... Read More

Autoresponders Make You Look Like A Pro

People like to get immediate responses to requests. Autoresponders are great for letting people know... Read More

Let Marketing Manage Your Website Content

The definition of the phrase "Content Management" depends on what the organization may need or... Read More

How To Make Your Website More Successful? (Part I)

Building a website and getting it online is easy. Driving visitors to it is the... Read More

Having a Portfolio on the Internet Can Help you Infiltate the Workforce

If you're an up and coming graphic/web designer just out of university, you'll know it's... Read More

KISS Your Website!

Many web developers today are starting to KISS their website, and it shows!No, I don't... Read More

PHP Redirect

A PHP Redirect automatically transfers a web user from one URL to another. For example,... Read More

Build It and They Will Come

Build it and they will come is not always true; you have to form a... Read More

Web Site Development Process - The Life-cycle Steps

A system development process can follow a number of standard or company specific frameworks, methodologies,... Read More

Make Your Artist Website Sell!

SummaryHere's the scoop on what you must know when designing a website to showcase your... Read More

How to Make Your Own Website For Free

If you like the Internet and surfing through the billions of web pages on it... Read More

Guide to Internet Business - Design and Content

After deciding what kind of internet business you want to do, it's time to start... Read More

Your Website Should Be Selling

It may come as some surprise to a traditionally off-line business that their website should... Read More

Three Way Linking - Webmaster Strategy

Three way linking and concerns.For many years SEO experts were happy with two way linking... Read More

Duplication vs. Individualism

How can we add Word Rich Content to our Websites without overtly duplicating others website... Read More

Web Accessibility: The Basics

What is web accessibility & why is it important?Web accessibility is about making your website... Read More

Sticking To Your Plan

So you have a good idea for a business and decided that the Internet would... Read More

Build a Strong Foundation for Creating Your First Online Identity ? Notes for Beginners

If you are looking for creating your online presence you should follow some of the... Read More

Why Local Service Companies Should Have a Website

The Internet is being used by local service business to improve sales today. Sales are... Read More

How to Create a Professional Web Site in 24 Hours

While creating a Web site may seem like a difficult, time-intensive and expensive... Read More

So You Want To Have A Website

So you want to have a website. You have gone on to the internet and... Read More

You Dont Know Which One

I still remember it very clear ... It was almost a decade ago that I... Read More

4 Marketing Tips for Resourceful Webmasters!

The internet is a sea of knowledge. Getting your information to 'float' by the right... Read More

Web Accessibility Myths

With more and more countries around the world passing laws about blind and disabled access... Read More

35% Revenue Increase? from Your Website!

2 Golden Rules for an Engaging Website35% of visitors fail to achieve their goal when... Read More

Free Webmaster Tools - 7 Things Every Webmaster Needs in Their Toolbox

Webmaster tools are vital to becoming both efficient and effective in your online efforts. The... Read More

Beware the Software Siren

I've heard several prominent web marketers mention in their classes and public forums how easy... Read More

What is The Google Toolbar?

No matter what browser you may want to use, you should consider using Google's toolbar.... Read More

Why a CSS Website Layout Will Make You Money

Although CSS layouts have been around for years, they haven't become so commonplace until recently.... Read More

7 Reasons YOU Need a Website

1) A marketing necessityI still hear it said from time to time that you... Read More

Achieving Differentiation With Your Website

Internet Marketing is not a miracle marketing strategy ? competition still exists and you... Read More

The Topic Of Your Website

The first thing you will have to deal building your website has nothing to do... Read More

How To Get Your Customers To Trust Your Website

Research reveals three important facts:1) The Internet is one of the most important sources of... Read More

Email Addresses in Web Pages

You want to give your site's visitors a way to contact you by email but... Read More

7 Killer Ways To Increase Your Online Sales

Every online entrepreneur I talk to is asking the same question, "How do I increase... Read More

Introductory PHP For Non-Programmers

When you started reading this sentence you assumed lo acabar?a en ingl?s. However, I didn't... Read More

The Secret Benefit Of Accessibility: Part 2 - A Higher Search Engine Ranking

An additional benefit of website accessibility is an improved performance in search engines. The more... Read More

How to Build a Database Driven Web Site

If you ever want to create a state directory, article directory, dating site or link... Read More

Getting One-way Inbound Links: the 5 Major Strategies

With search engines putting a damper on direct reciprocal links, the hunt for the elusive... Read More

Do Dancers Need A Website?

Dance is how you pamper your soul and satiate your creativity. Mesmerized and overwhelmed with... Read More

Planning A Usable Website: A Three-step Guide

A website is like an information flow, with you as the provider and your site... Read More

You Need To Treat Your Website Like An Employee - Heres 5 Ways To Do It

People often come to me in a state of crisis and say their website isn't... Read More

Using Mini Websites - Powerful Way to Direct Marketing

Mini Websites are the most powerful and cost effective solution to promote and market your... Read More

Website Sales: 10 Reasons Why People Dont Buy From You

You've put up a website to promote a product or service.You've spent piles of cash... Read More

10 Tips For Running A Profitable Web Site

1. Address your targeted audience on your business site. Example: "Welcome Internet Marketers". If you... Read More

Do You And Your Website Have Credibility?

I recently received an unsolicited e-mail from some company offering me their search engine optimization... Read More

Art, Artists, and the Web:Part: 2--First Steps in Building an Artist?s Website

What you should do and know if you are an artist and you have decided... Read More