Template
An Outline
Designed for small Web sites having access to php, but lacking mysql or a similar Database, this Templating system is based on using a "flat-file" to contain the information required to build the Sidebar Menu and to similarly handle the security of the Query string used to select the intended display page.
The security isn't fool-proof, (what is on the Web?), but it is a step in the right direction.
Using an "If" structure, the Query string is inspected, and checked against an array to see if the page being requested exists in the array. If it is not in the array, then the 'default' page is served up.
If the Query string is in the array, and the file exists, that page is served up.Otherwise, the page served is the page listed first in the Menu Sidebar. By default, this page is titled "Index.txt".
Altering the Menu
Review the page titled Sample Menu Data to review the structure of the "flat-file"
It is a simple text file containing 5 comma seperated values for pieces of text the Sidebar script uses to create the Links in the Sidebar. The details are listed on Page Four of this Sample.
Altering the Pages
The Template includes pages named index.txt, one.txt, two.tx, three.txt, and four.txt. These are the basic pages used for this template. Simply edit the page contents to be what you wish them to be. Html and php scripts can be used on the pages to allow for dynamic page creation and to alter the presentation of data.
Cascading Style Sheets are used to control the Presentation. Be careful altering items which control the Structure of the page. If you aren't familiar with the difference between items which are for structure and items which are for presentation, you shouldn't be altering the file.
Download Zip file: HERE
The author reminds you that this zip file is provided as a learning tool and assumes no responsibility for the consequences of using this template or any portion of the code on a live site. This template provides no security against attempts to 'hack' the pages. You must assume that any user input is bad. Steps must be taken to cleanse the data. Do NOT use this Template on a live site where security is required.
Previous page: The Contact Page Next page: The Template Script