|SAMS Teach Yourself PHP4 in 24 Hours
How This Book Is Organized
This book is divided into four parts:
is an introduction to PHP4.
Part 2 covers the basic features of the language.
Pay particular attention to this section if
you are new to
Part 3 covers PHP4 in more detail, looking at the functions and
techniques you will need to
become a proficient PHP programmer.
illustrates a complete self-contained example.
Part 1 contains Hours 1
through 3 and handles the information you will need to get your first
up and running:
Hour 1, "PHP: From Home Page to Portal," describes the
history and capabilities of PHP
and looks at some of the compelling reasons
for deciding to learn this scripting language.
Hour 2, "Installing PHP,"
explains how to install PHP on a UNIX system and discusses
some of the
configuration options you might want to choose when compiling PHP. In
hour, we also look at PHP configuration options.
Hour 3, "A First
Script," looks at the different ways in which you can embed a PHP script in
document and create a script that writes text to the user's browser.
comprises Hours 4 through 8. In this part, you will learn the basic components
Hour 4, "The Building Blocks," covers the basics of
PHP. You will learn about variables,
data types, operators, and
Hour 5, "Going with the Flow," covers the syntax for controlling
program flow in your scripts.
In addition to if and switch constructs, you
will learn about loops using for and while
"Functions," explores the use of functions to organize your code.
"Arrays," discusses the array data type that can be used to hold list
We will also look at some of the functions that PHP4 provides to
Hour 8, "Objects," introduces PHP4's support for classes
and objects. Throughout the
course of the hour, we will develop a working
Part 3 consists of Hours 9 through 22. In this part, you will come
to grips with the features and
techniques of the language:
"Working with Forms," introduces the dimension of user input through
mechanism of the HTML form. You will learn how to gather data submitted
via a form.
Hour 10, "Working with Files," shows you how to work with files
and directories on the local
Hour 11, "Working with the DBM
Functions," demonstrates PHP4's support for DBM
database systems, versions of
which are available on most systems.
Hour 12, "Database Integrationâ€”
MySQL," provides a brief introduction to SQL syntax and
introduces the PHP4
functions that can be used to work with the MySQL database.
Hour 13, "Beyond
the Box," covers some of the details of HTTP requests and looks at
Hour 14, "Working with Dynamic Images" explores PHP's image functions. With
can create GIF or PNG files dynamically.
Hour 15, "Working with
Dates," covers the functions and techniques you can use for date
We create a calendar example.
Hour 16, "Working with Data," revisits data
types and explores some more of the functions
you can use to work with data
in your scripts. More array functions are also covered.
Hour 17, "Working
with Strings," covers the functions that you can use to
Hour 18, "Working with Regular Expressions,"
introduces regular expression functions.
You can use these to find and
replace complex patterns in strings.
Hour 19, "Saving State with Cookies and
Query Strings," shows you some techniques for
passing information across
scripts and requests.
Hour 20, "Saving State with Session Functions," extends
the techniques explored in Hour
19, using PHP4's built-in session
Hour 21, "Working with the Server Environment," shows you how to
call external programs
from your scripts and incorporate their output into
Hour 22, "Debugging," shows you some techniques that you can use to
problems in your code. We also examine some common errors.
4 consists of Hours 23 and 24. In these, we build a working example that
some of the techniques that were introduced earlier in the
Hour 23, "An Example (Part 1)," creates a brief for a club listings
script. We build the code
that will allow users to create accounts and enter
Hour 24, "An Example (Part 2)," concludes the project, building the
code for nonmembers
to browse the listings and look at club profiles.