best viewed with TrebuchetMS & AndaleMono

About Me

PHP 1 2 3- File Components (Templates)

PHP
As promised- a simple tutorial on templating (you may first want to read the previous introductory entry). Let me first define a little terminology. A template, as the word is used here, is a part of a document that you can use in more than one page. These document sections are placed in separate files and are then used to 'build' your page by being 'included' into their respective positions on the page. We will use the PHP function include() which, as its name implies, includes local php files. We also have the option of using the readfile() function if there is only HTML markup (no PHP code) in the files to be included.

<?php and ?> are the standard start and end PHP tags. The PHP engine will process any file with a .php extension, executing the code contained by the tags. Without these tags, the code would be mistaken for HTML and output to the browser as is.

Okay, let's begin... Read the full article

 

1 Comments:

Blogger Fading redhead said...

Clear, concise, admirably written. Now, for the attempt! I will tune in for more. Good booklist.

5:02 PM  

Post a Comment

<< Home

To the Top