| ||||||||||||||||||||||
|
|
Creating a dynamic php website with templatesPHP allows you to separate content from code. Standard HTML pages have all the web design code and content on each page, even though the design code is the same throughout the site. That's a lot of repetition. And when you want to update the site's design or menu links on a standard HTML site, you have to change this information on every page. With PHP you can separate the design code from the pages. If you applied this in its simpliest form, you would have one page (header.php) that held the top of the page's HTML code, a content page (mypage.php) and a footer page (footer.php) that held the bottom of the page's HTML code. By placing a marker on your pages, the HTML design code (from header.php and footer.php) would automatically be inserted each time the page (mypage.php) loads in a visitor's browser. If you want to change a menu link or the entire site's design, you only need to change one or two files instead of every page on your site. PHP is easy to incorporate into any site. If your site has fewer than 25 pages, you can definitely benefit by setting up your site as described. But if you have a larger site and need to manage a lot of content, the best solution would be to download a free PHP content management system (CMS). A CMS will automatically create page links and site navigation for you, and all your content will be stored in a database. When a visitor clicks on a link, the CMS will dynamically deliver your content. Other benefits to PHP-based CMS programs is that many already come with a member management system, forums and other features you may need as your site grows. Professionally-designed website templates can be incorporated into almost all of these programs. Many templates are even specifically made for the most popular ones. Some popular PHP-based CMS programs:
As you create new content pages for your site, you can save them with the .php extention. If you would prefer your pages to have the .htm extention, you will need to "tell" your site to handle .htm files as .php files by adding the line below to your existing .htaccess file or by creating a new .htaccess file. Before doing this, please take a moment to read the .htaccess overview. Save this page as header.php Save this page as mypage.php Save this page as footer.php Now upload all three files to your server and open mypage.php (it should look like this). You should now have a basic idea of how the page is structured. To duplicate this process for the pages on your site, begin by taking the HTML code that forms the top and left side of your website and placing it into header file. Repeat this for the footer code. If you are working with a new website template, you will need to look at the code to determine where to separate the HTML page structure from the content areas. |
|||||||||||||||||||||
| © 2003-2006 PHP Website Templates All rights reserved. | ||||||||||||||||||||||