Target versus Include Part 2 - Include

In this simplistic illustration of this use of frames, we do not really need the target function, but rather the include function. If the menu was made into an include file, then it can be inserted in each page, rather easily and very simply, and would achieve the same goals and results that the frames were expected to deliver.

This can be done very simply by using the include directive/function of sever-side scripting, using SSI or PHP. To illustrate this, lets say that, we made a file left.txt, that contains everything you wanted to appear on the left panel (the menu, logo, etc.). This file can be inserted into every page by including the following short codes:

Both are simple to implement, and produces the same result. The choice really depends on what your server supports. If it is only one, then the decision is made for you. If you have both options, I would venture to offer the following suggestions:

Please note that:

When using the SSI option, you do not have to change the file extension of the main file (i.e. the file that contains the included pages); .htm or .html extensions are perfectly acceptable. But, when you are using the PHP extension, it would be advisable to use .php extension.
However, with either option, it is highly recommended that you first check the instructions provided by your server and/or consult with their support team, to assure a smooth implementation.

Side Notes:

Relative Paths

The above illustration of including files using SSI and PHP is based on the assumption that both the including and the included files are in the same directory.

However, when multiple directories are involved, the use of relative paths requires futher considerations.

Relative to Current Directory:

Relative to URL:

Next Step

Now that we have identified the include function and seperated it from the target function, we can address the latter in Part 3 of this article.

Feed-back & Comments:
Please send any comments, opinions, and even contributions on this subject, using the Feed-Back Form.
Further Reading:
You can review the list of Related Articles, with brief descriptions and links on the Auxiliary Panel,

Web Design & Engineering: Dr. Z
© 2004-2008 Martian Melodies.
All rights reserved.www.Web-ZoneZ.com