PHP Manual: A Simple Tutorial

THe PHP Manual is a simple and brief demonstration of some basic PHP exercises. The tutorial was presented in several steps, and I have created a separate page for each section the tutorial to preserve the integrity of the original demonstration. Please click the preview images below to view the full PHP demonstration page.

Your First PHP-Enabled Page

This section was a very simple demonstration of how to display text using an echo statement. It also contains a phpinfo() function which displays useful information about your current system and setup, such as available predefined variables, loaded PHP modules, and configuration settings.


Something Useful

The second section illustrates the $_SERVER superglobal, which can be used to determine the browser the user is running and return the result. It then demonstrates a simple 'if' statement, which will only print if the user is using Internet Explorer. The second set of statements are a mix of HTML and PHP which will give output whether or not the user is using Internet Explorer.


Dealing with Forms

The third section demonstrates a very simple form which will accept the user's name and age. Once the user hits 'submit', they are taken to an action.php page which will print the data given in the form. The form contains an htmlspecialchars() function which will ensure that any characters that are special in HTML are properly encoded, so HTML tags or Javascript cannot be erroneously injected into the page.


The tutorial concludes with links to public repositories and libraries containing code that can be reused.