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

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

You Don?t Have to be Amazon.com to Achieve 12% Conversion Rates!

That's right. According to a recent study by Nielsen/NetRatings, Amazon.com converts 12.8% of its visitors... Read More

Setting Up Your First Website

Q. Hey, Cathy: I'm just setting up a website. What should I do?A. First, don't... Read More

From Concept to Website

You've decided to create a website to market your products or services. More and more... Read More

Newsletter Management Using PHP w/o mySQL for Beginners

Let's begin by setting some limits. If you're like me, you like to keep it... Read More

Web Accessibility Myths

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

Are Web Graphics Stealing Your Money?

They might not be wearing a mask and carrying a gun, but if you've got... Read More

Topics to Add When Creating an Alternate and Modern Medicine Web Directory

Alternate medicine finds its own place in the hearts and minds worldwide and has a... Read More

The 2 Most Common Web Site Mistakes

When we review the sites of potential clients, there are 2 mistakes we see over... Read More

What Does An Ex-Basketball Coach Know About Pulling Web Metrics?

In my previous life.....Actually, my previous JOB life, I was a physical education teacher and... Read More

The Cost Of A Web Site

Just starting out, you can start with a simple informational site, which is all most... Read More

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.... Read More

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... Read More

Five Steps to Create Your Software Product with Outsourcing

Many executives and investors are skeptical that software products can be developed using outsourcing. Even... 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 You Need a Web Database?

Does My Web Site Require A Web Database?If your web site require constant updates and... 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

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... Read More

Credibility - 10 Ways to Build it on Your Website

If you have your own business website and you are trying to sell something, then... Read More

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... Read More

Web Design for the Professional Magician Part I - Selecting the Perfect Domain Name

Selecting the Perfect Domain NameThe first issue I have with magician web sites is the... Read More

Improving Usability for Screen Reader Users

Simply ensuring your website is accessible to screen reader users is unfortunately not enough to... Read More

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... Read More

Flash Deadly Sins (That Can Kill Your Web Business)

Looks like every client wants a Flash site these days but the reality is...as flashy... Read More

Guidelines for Web Page Optimization

Below, I have listed 8 simple steps that you can take to optimize your web... Read More

How to Get Your Website In Front of Thousands of Customers At No Cost To You!

Dan Kennedy once said that if you can't make money without money? then? you won't... Read More

How One Word Or Even One Letter Can Boost Conversion Rates By Over 400%!

Recently I was reviewing the keyword specific conversion rate data of a consulting client of... Read More

Make Your Communication Come Alive

Design and layout can make your communication come alive and your message immediately apparent. Now,... Read More

The Top Ten Benefits of Having a Web Site

Do you need a web site? Are you considering getting one but are unsure? Here... Read More

Warning: The Truth About Having a Web Site!

If you don't have a web site yet, are thinking of slapping one up or... Read More

What Hosting Companies Dont Tell You, Could Hurt You?

Did you know that hosting companies overcrowd their servers despite all the issues caused by... Read More

Ever Wondered What Challenges Other People With Their Web Site?

Have you ever wondered what challenges are faced by other webmasters and owners in the... Read More

The Power Of CPanel

cPanel is a control panel for your website and allows you to set up and... Read More

But My Business Doesnt Need A Website!

Revenues are often lost because many business owners don't see the value in having a... Read More

Why to Have a Website for Your Company

After having decided to start a business, the next thing that arrives in your mind... Read More

Cost Effective and Powerful Dynamic Websites w. Fantastico Web Hosting

If you are developing your website on a host that charges less that $5 a... Read More

What Business Owners MUST Know BEFORE They Commit To Having A Web Site

Q1.Why would I need a web site? A1.- Improve my service by providing the existing... Read More

From Search to Sale

The Internet car buyer is an elusive animal. Trying to hunt them down for the... Read More

Ten Ways NOT to Set Up a Website-based Service Business

1. As the first step, "Hire a web designer."First create a storyboard of your website,... Read More

Does Your Business Really Need A Website?

Website, website, website, everyone says you need one. But do you really? It all depends.... Read More

Get a Website!, Register Your Domain!: To Website or Not to Website?

If you're fairly new to the Internet scene, you may just be a bit overhelmed... Read More

Dreamweaver 8 Preview

August 8 2005, Macromedia announced a release of Studio 8. Based on the feedback of... Read More

Website For The Company Store

If your company own one or more stores, you might be wondering if it would... Read More

Learn to Build a Better Online Business Website Using Keywords and Content

Are you aware that 90% of the websites on the Internet today are a waste... Read More

Things to Consider Before Starting a Website

In the time that I have been using the Internet, (since 1996) I have seen... Read More

Having a Domain Name And Web Site Gives Your Business The Key To The Door

Just like all things in life, the ways to run a business are rapidly changing... Read More

Marketing Your Business Online

As a business you can't afford to ignore the Internet Age; in 2002 there was... Read More

Growing Your Meetings In CyberSpace

As increasing numbers of people search for information on the Internet, it becomes more imperative... Read More

Make Your Own Brand!

There are millions and millions of websites on the Internet. You NEED to be different... Read More

7 Questions to Understand Your Customer Better

Customer service questionnaires can help your clients better understand their requirements. Your clients can benefit... Read More