Skip to main content

Mastering PHP 4.1

Mastering PHP 4.1

Jeremy Allen, Charles Hornberger

ISBN: 978-0-782-12924-3

Apr 2002

709 pages

Select type: Paperback

Product not available for purchase


Build Dynamic, Database-Driven Web Sites

PHP is a fully developed, server-side embedded scripting language, and its importance for web application development has grown with the rise of the Apache web server. Are you a novice programmer? This book starts with the basics and takes you wherever you want to go. A seasoned pro? You'll be amazed at how much you can capitalize on PHP's power and object-oriented support, and how it leverages your knowledge of other languages. Finally, if you're a PHP user in search of an authoritative reference, you need look no further. Mastering PHP 4.1 guides you through all levels of real-world web programming problems and provides expert advice on which solutions work best.

Coverage Includes:

  • Reading and writing files
  • Validating data with regular expressions
  • Accessing MySQL and PostgreSQL databases
  • Accessing LDAP servers
  • Generating images and PDF documents on the fly
  • Building authentication and access-control systems
  • Sending e-mail and building web-to-e-mail interfaces
  • Creating your own classes
  • Closing common security holes in PHP scripts
  • Parsing and generating XML documents
  • Using sessions to store persistent data
  • Debugging misbehaving scripts
  • Encrypting and decrypting sensitive data

Note: CD-ROM/DVD and other supplementary materials are not included as part of eBook file.


Part 1: The Basics of PHP.

Chapter 1: Beginning Your Exploration of PHP.

Chapter 2: Variables.

Chapter 3: Operators and Expressions.

Chapter 4: Flow Control and Functions.

Chapter 5: Strings and Arrays.

Part 2: Programming Principles and PHP.

Chapter 6: Object-Oriented Programming.

Chapter 7: Debugging and Errors.

Part 3: Letting the Data Flow.

Chapter 8: SQL and Database Interaction.

Chapter 9: Forms and User Interaction.

Chapter 10: Data Validation.

Chapter 11: Sessions.

Chapter 12: Security.

Chapter 13: Files and Networking.

Part 4: How PHP Is Connected.

Chapter 14: Web Application Development.

Chapter 15: XML and XHTML.

Chapter 16: LDAP.

Part 5: Using PHP in the Real World.

Chapter 17: PDF.

Chapter 18: Generating Graphics.

Chapter 19: E-Mail.


Appendix A: A Crash Course on Installing PHP.

Appendix B: PHP Configuration Options.

Appendix C: XHTML Entities.


Chapter 10 PDF
Index PDF
ZIP file containing Dictionary.txt
ChapterPageDetailsDatePrint Run
Combined Errata

Page 0 CD

In the SRC Folder (Source Code), there is not any available code for Chapter 14.

Page 7

Listing 1.1 line 8: single quotes must be changed to double quotes or the escape character is not interpreted.

Page 27

Exercise for Floating-Point numbers The next-to-last line should be changed from:" $my_float = 1+E12;" to: "$my_float = 1E+12;"

Page 65

Code Snipped just before "Order of Expressions" should read: see detailed description
$pos = strops($str,$look_for); // it should be strpos(....).

Page 151

Ref'd Dictionary.txt file missing from CD. Can be downloaded from,typeCd-DOWNLOAD.html.
The following Zip file contains Dictionary.txt.

Page 372

Example code for the function skey_get_user_id the statement :"$fp = fopen($keyfile, 'r');[" should be :"$fp = fopen($keyfile, 'r');"

Page 612

Line 16 should read - if (strlen($label))

Page Appendix A Note

>> Also appendix a- installing apache on windows os gives bad commands
>> for starting and stopping apache. "net stop apache" and "net start
>> apache" should be "apache -k shutdown" and "apache -k restart" on a
>> windows system.

This depends on whether the reader has installed the Apache server as a

Basically, Apache can be configured several ways under Windows, dependant
on the version.
If you are using Windows NT, or 2000 (I am unsure about XP), you have the
option of
installing Apache as a service, which is what the author has done, and
the book is
correct in this regard.

I'm assuming the reader has Windows 95 / 98 / ME where this is not an
In this case his instructions are correct.

Mark Godfrey