Posts Tagged ‘Includes’

Guide to Server Side Includes

Introduction to Server Side Includes

Newbie? It’s OK!

Although much has been written for Server Side Includes (SSIs-also known as Virtual Includes) much of this information is designed for advanced intermediate webmasters. This article is intended for beginners. It is assumed that the reader has no previous knowledge of scripting languages, server or other advanced computer skills. This article introduces the reader to the SSI and how they are used in the development of websites. SSIs are guaranteed to save you time your web site evolves and changes over time.

Server: A place for your stuff?

It ‘important to understand that all of the code of your site are stored remotely on a computer called a server. This is a very basic level, the server (remote computer) is the only place where you can store files in the “net”. These files usually contain HTML Web site and possibly some of the files that contain images or graphics.

For example, a very simple web site can be composed of five similar sites five files that are stored on the server. A file is named index.html, and we have four other files. These files may be called some-Me.html, education.html, and resume.html portfolio.html. Let’s say that this is a simple 5-site run by a professional who uses this site to a sort of virtual advertising.

Server Part 2: more storage?

We found that the server acts as a storage place for our files, but it is important to identify the servers can also do things. Such software, operating systems, personal computers, servers, software that allows them to access and organize files. The server can also perform additional functions. Take, for example, the server does when someone visits the site in the root directory, the server automatically download directory (for example, index.html, index.php, index.asp). This is a very simple example of something that happens “on the server side.”

Why am I covered?

Now we understand that the remote servers have software on their ability to perform certain tasks, we can direct our attention to the “includes” part of the equation. What is included? Consider our hypothetical web site serves as a freelance advertising of our imagination. Imagine that the independent design of a navigation menu on the left so that people can easily browse all five pages of their sites. Therefore, all pages of this site contain the code for the navigation bar. Imagine that a few months after the launch of this website, our freelancer wants to add an FAQ page. Our freelancer is now to update the navigation bar code on each of its five existing pages. Now there are six pages of this navigation bar code itself. A month later our freelancer wants to add an item to your self-written site. Again, each page must be updated. Imagine having a site with 100 pages.

Do you want to manually update the 100-some pages of code? These are the types of situations where virtual includes can save you hours of time.

What we are, including the server side?

It might be better to think that includes “modules” that can be embedded in web pages. These modules (or “includes”) are generally text files that contain HTML (although there may be other formats). The code within these files can be inserted anywhere on a page or by using an include. For example, imagine for a moment that the freelancer had the vision to understand that shipping was going to change sometime in the future. Instead of putting the code for the navigation menu on each page, independent journalist put this code in a separate file. For the sake of example, we call this file nav-menu.html Our freelancer can now simply do an “include” command that refers to the navigation-menu.html anywhere he / she wants to put this menu. The advantage of this is evident when you become a freelancer you have to modify the navigation menu. More than one file must be edited, nav-menu.

html, and all pages that contain “include” in reference to this file will be automatically updated. This time saving is the main advantage of using includes.

OK, now I understand, but that show?

Although this is not an article “technical”, many of you are probably wondering what “is” seems. Therefore, one of the following is an example of PHP. Please note PHP is only one type of scripting language that can be used, depending on what the server is running. In this example, the code file “menu.html NAV ‘is added to any web page where you can find the code:

<center> <img src=”http://www.kabooli.com/articles/web-site-design/ssi.jpg” alt=”"> </ center>

Keep in mind that for technical reasons, SSI is not visible when you view the source code page in the browser. This is due, among other things happening on the server (before the presentation of the result code to the browser). This makes the use of SSI invisible to browsers, bots, spiders (which is why we have search engines)

Summary

The Catch-22 includes the server side is that the need does not manifest itself when faced with the task of updating the tens or hundreds of pages of code. There are many resources on the web that tell you how to use virtual includes, and procedures vary depending on the programming language supported by the server (eg ASP, PHP). I hope you now understand the server side and how they can benefit from the webmaster.