_
_ Handy PHP
_
_
Tutorials, Scripts, Information And Other Resources arrow PHP Tutorials arrow Creating Your First Template Driven PHP Website Part 1
Sunday, 07 September 2008
_

Refer A Friend using Revolution Money Exchange
Resource Menu
Handy PHP Store
Free Domain Name
PHP Functions
PHP Downloads
PHP Newsfeeds
PHP Tutorials
Webmaster Tools
User Login
TalkPHP
Get friendly help with your PHP problems for free.
www.talkphp.com
The PHP Resource Index
Handy PHP
Free PHP Help!

Creating Your First Template Driven PHP Website Part 1 Print E-mail
Written by Handy PHP Administrator   
Monday, 23 April 2007

Using all of the same files as before except the index.php file we can create additional content pages like so:

content1.php Sample 2

CODE: content1.php
<?php

$site_title = "My Website";
$page_title = "Sample Template Content Page 1";
$main .= "<div style=\"text-align:left; margin:10px;\">Here I can place any kind of content I want. By using a template and a few static content files with each page of my website, I can quickly add, reformat, update, or otherwise modify the content on my website.</div>";

require('header.php');
require('main_menu.php');
require('footer.php');
require('template.php');

?>

The file above would output the following when used with the files specified: template_sample2_2.jpg

     This is a different page than index.php but was created the same way. This means that the website is static in that the pages are put together using direct data. No manipulation of data has occured and the pages are dumb in nature. Dynamic content can be easily added to the website at this point on a limited basis since the use of a template and modules allows information from one file to influence information in another file.

 

 

 

 

 

     Using this method of templating will provide you with a quick and easy website or can be used as the means by which you convert your pure HTML website to PHP. For more information on converting yout HTML website to PHP, you may find this article helpful: Converting HTML to PHP Basic Tutorial. Additional tutorials regarding this topic will follow soon.

Discuss this article on the forums. (0 posts)



Last Updated ( Sunday, 18 May 2008 )
 
< Prev   Next >

_
 
_
_
© 2008 Handy PHP