PHP
PHP is yet another powerful tool that sites can make use of. The possibilities are endless, so in this short tutorial, only one aspect will be covered, namely the use of includes. This is a fairly simple procedure that allows one file to govern a section of code.For example, one file can be created as a footer, header, or menu, then included as one line of code in as many pages as you desire. This means that on a site containing hundreds of pages, a link can be added or withdrawn from a menu without having to edit each and every page, rather just one master file.
Say we make a menu as a list that appears much like a part of our menu on this page:
<ul>
<li><a href="html_tables.html">tables</a></li>
<li><a href="html_lists.html">lists</a></li>
<li><a href="html_images.html">images</a></li>
<li><a href="html_maps.html">image maps</a></li>
<li><a href="html_links.html">links</a></li>
</ul>
This code, and only this code (no <html>, <head>, or <body> tags included), is then saved as menu.html. On 20 of our pages, we then add this one line of code:
<?php include("menu.html"); ?>
This menu is then called from the file and displayed on the webpage, wherever that line of code is placed. If a link then needs to be added, only menu.html needs to be edited, while the other 20 pages remain the same, with just that one line of code.
There are a couple other pieces of information that are important to know when using php. The first is that any page using that line of code, or making use of php, needs to end in .php instead of .html. The menu code doesn't use php, so it can be named menu.html, but each page that uses the php include is then home.php, html.php, css.php, about.php, and so forth.
One drawback is also that php needs to be installed on a computer before a page using it can be displayed. This means either third party software needs to be installed, or a site needs to be uploaded to a server before it can be viewed in a browser. This can make the process a little more tendious, but it often saves much more time in the long run, on a site containing much information.
For more information on the subject, visit this site.