When you design a website using entirely HTML and you have a header and navigation menu bar or column, every time you start a new page you will copy the header and menu from a previous page.
However, when the client later asks for a page to be added to the website, all the menus on the existing pages need to be edited and the new web page link to be inserted.
This is where PHP can help. If you have just one file with the header and menu, you can use PHP to include that file at the top of every page. So instead of editing say 30 pages, you just edit the one common header file.
PHP code to include the common header page on every web page is
<?php include "header.htm" ?> where "header.htm" is the file with information common to all the web pages.
The same method can include a common footer in each web page or any common paragraph.
Files containing PHP code should be saved with the extension .php - e.g. index.html should be saved as index.php.
PHP has many uses but this is the first to try.
For a short simple tutorial go to http://us2.php.net/tut.php
|