From HTML to PHP: Intro
- 0 Comments
Most people learn HTML when they first learn to create websites. Either that or they use free software in the form of CMS (Content Management System) or a web template. For those creating static HTML pages, there comes a point where managing the site gets progressively harder and harder as there is more content on the site.
The relationship between PHP and HTML is simple: PHP is a programming language while HTML is a markup language. The HTML is what displays on a webpage, whereas PHP retrieves, captures, submits, and saves data.
This is when those webmasters should start learning some basic PHP and perhaps MYSQL as their site gets larger. The most important PHP function for webmasters is most likely the include() function. This is because, webmasters often tweak their layout or add links to the navigation bar and end up having to manually edit every single HTML page of their website.
An example of the function would be:
<?php include(”header.php”); ?>
This basically tells the computer to download another file called header.php and insert it there. The most practical use of this is to make it easy for you to change your site navigation, the header, the footer, the sidebar, and all parts of the page except the content area. People also commonly use .inc or include files as the type of file called up.
A standard page would then look like this:
<?php include(”header.php”); ?>
Content about your site with appropriate HTML tags.
<?php include(”footer.php”); ?>
The header would include the body tag, the html tag, the meta tags, as well as the upper half of the web page. The footer would close the html tag, the body tag, any tables, and would include the bottom half of the web page.

