Before you start
This tutorial finishes the simple workflow application you began in the first part of this series about learning PHP. You will add HTTP authentication, the ability to stream documents from a non-Web-accessible location, and exception handling. You'll also organize some of the application into objects.
Overall, you will add the ability for an administrator to approve a file, making it generally available to users. Along the way, the following topics will be discussed:
- Enabling and using browser-based HTTP authentication
- Streaming data from a file
- Creating classes and objects
- Using object methods and properties
- Creating and handling exceptions
- Using XML ID attributes
- Validating an XML document using a Document Type Definition (DTD)
- Controlling access to data based on the requesting page
Who should take this tutorial?
This tutorial is Part 3 of a three-part series designed to teach you the basics of programming in PHP while building a simple workflow application. It is for developers who want to learn more about advanced topics, such as using PHP for object-oriented programming. This tutorial also touches on HTTP authentication, streaming, classes and objects, and exception handling, as well as provides another look at manipulating XML.
This tutorial assumes familiarity with the basic concepts of PHP, such as syntax, form handling, and accessing a database. You can get all the information you will need by taking "Learning PHP, Part 1" and "Learning PHP, Part 2," and by checking the Resources.
To follow along with the sample code, you need to be sure the following tools are installed and tested:
HTTP server -- You can install PHP on a variety of HTTP servers, such as Apache and Microsoft® IIS, and on Windows®, Linux®, UNIX®, Mac OS X, and other platforms. In general, your choice of server doesn't matter, but this tutorial will cover some configurational issues regarding HTTP authentication using Apache 2.X as an example. You can download the Apache HTTP server from Apache.
PHP -- Of course, you will also need a distribution of PHP. Both PHP V4 and V5 are in use at the time of this writing, but this tutorial concentrates on V5 because of its enhancements. Download PHP.
Database -- Part of this project involves saving data to a database, so of course you'll need one of those, as well. This tutorial covers MySQL because it's so commonly used with PHP. You can download MySQL from http://dev.mysql.com/downloads/index.html.

