This book is packed with 24 chapters and 2 case studies. We will also supply 4 appendices online. The chapters are divided into five parts:
Part 1 explains the whys and wherefores of PHP4. It also gives the professional programmer a good handle at customizing their PHP installation:
Chapter 1 introduces you to PHP4 and why it is so useful. It also gives a broad idea about the evolution of PHP and compares it with other scripting languages available to the programming community today. It concludes with a good resource list for further references and useful documentation.
Chapter 2 is all about installing PHP with web server and database support on *nix, Windows, and Mac OS X platforms. This chapter particularly refers to installing PHP with the popular Apache web server, and the widely used MySQL database.
Part 2 explains the core of PHP. We will look at PHP's syntax, important built in functions, and object-oriented programming. This is meant for intermediate programmers of PHP:
Chapter 3 walks you through the basic constructs of the PHP language – PHP scripting elements, literals, variables, data types, expressions and operators, form variables, and system variables.
Chapter 4 talks more about flow control, functions, and arrays.
Chapter 5 tells us that object-oriented programming is essential for PHP to survive as the web platform of tomorrow. It looks into the basic building blocks of OO programming, inheritance and polymorphism, object modeling using UML, and some more design heuristics and good coding practices.
Part 3 covers issues outside the typical PHP web application environment such as coding FTP clients, network-related function calls, and directory services:
Chapter 6 focuses on various programming pitfalls, their avoidance, and the tools at our disposal to minimize and thwart erroneous code.
Chapter 7 concerns itself with handling user input with OOH Forms, regular expressions, and a sample application that does it all.
Chapter 8 looks at session management and PHP's ability to track users among multiple pages by using cookies.
Chapter 9 examines PHP's built in functionality to handle files and directories in the server's file system. It also walks us through an online storage application that allows users to store data on a remote server.
Chapter 10 focuses on PHP's FTP extension that is well suited for automated file transfer or for building web-based FTP clients. It also takes us through two applications: building an FTP library convenience wrapper and a basic web-based FTP client.
Chapter 11 introduces us to the basics of e-mail and Usenet as well as the common protocols that servers and clients use to talk to each other – SMTP and NNTP.
Chapter 12 builds upon Chapter 11 looking at additional protocols needed to retrieve e- mail from the server (POP and IMAP), creating a class that can pull e-mail messages or news articles from a server, and building a general-purpose web-based e-mail class with Hotmail-like functionality.
Chapter 13 examines the functionality available to PHP scripts to connect and interact with other services that adhere to various TCP/IP-based protocols.
Chapter 14 focuses on the buzzword in directory services, LDAP. It also walks us through building an employee directory application that illustrates the use of the PHP LDAP API.
Part 4 talks all about multi-tiered development, using different databases, and the use of XML:
Chapter 15 is an introduction to building multi-tiered applications. It teaches the use of OOP programming, abstraction classes, and APIs that are keys to a successful multitiered architecture. It also looks into a common HTML-based multi-tiered architecture, and a brand new approach using XML.
Chapter 16 is a case study that uses the knowledge absorbed in the previous chapter. It steps through the complete software development lifecycle of a shopping cart application for mobile devices (using WML).
Chapter 17 introduces the power of a relational database to serve content for the PHP- driven application. It also examines using PHP's MySQL functions, building an online library application with MySQL as the back-end. Finally it looks at creating a customized database abstraction layer.
Chapter 18 looks into adding PostgreSQL support to PHP and the ways in which the PostgreSQL database can be accessed by the scripting language. We also rewrite Chapter 17's data-driven application using PostgreSQL, and extend the previous chapter's database abstraction layer.
Chapter 19 attempts to closely pack an overview of ODBC in with installation instructions, tips and tricks that will save us time (or get us out of trouble), and examples of how to use ODBC in real world situations.
Chapter 20 examines the usage of PHP as a command line script interpreter and examines a simple interactive script in the form of a small number guessing game. Finally it looks at PHP-GTK, the PHP extension that allows client-side, cross-platform GUI application programming. We also build a GTK interface to the application that we built in the previous 3 chapters.
Chapter 21 looks at different ways to read a fairly basic XML file and present it to the browser as an HTML table. It also looks into the PHP APIs SAX, DOM, and PRAX that allow interaction with an XML document, and the Sablotron XSL support for PHP.
Part 5 covers issues such as internationalizing, securing, and optimizing PHP applications. It also talks about the PHP extension libraries:
Chapter 22 is an exploratory dive into internationalizing scripts in PHP. It also traverses some more real world code challenges that demonstrate work arounds to the regular approach, and some architectural suggestions for effective use of non-linear language constructs.
Chapter 23 examines various aspects of security, from securing the server, securing the database and communications, and writing secure scripts, to choosing secure passwords.
Chapter 24 concerns itself with tips, tricks and techniques that can be used to optimize PHP code and relational databases.
Chapter 25 is all about the libraries that provide extensions to PHP's core language. It talks about using PDFlib to generate PDF documents, Ming to generate dynamic Shockwave Flash files, HAWHAW to allow wireless users to view our sites, and uses the GD library to create dynamic images, thus catering to the needs of almost any Internet user.
Chapter 26 is a case study that demonstrates a general-purpose system for keeping track of user privileges.
The four appendices are a complete reference for PHP taken from a CVS snapshot in between versions 4.0.5 and 4.0.6. This reference goes beyond the documentation written by the creators of the various APIs, filling in gaps where appropriate on CVS related material where possible, and adding text as necessary:
Appendix A is a list of all the extension functions
Appendix B lists all the basic and standard extension functions
Appendix C is a list of database functions
Appendix D lists the various configuration directives
The appendices are available online at http://www.apress.com. We will keep this online resource updated to reflect subsequent version changes in PHP.