Home > Store > Programming > PHP

Advanced PHP for Web Professionals

Register your product to gain access to bonus material or receive a coupon.

Advanced PHP for Web Professionals


  • Your Price: $31.99
  • List Price: $39.99
  • Usually ships in 24 hours.


  • Copyright 2003
  • Dimensions: F
  • Pages: 368
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-008539-1
  • ISBN-13: 978-0-13-008539-9

  • Build complex, PHP-driven Web sites—fast!
  • Discover powerful new PHP techniques, hands on!
  • Learn all-new techniques based on PHP-GTK and PEAR::DB
  • Master XML parsing, user authentication, forms processing, data mining, and much more

Take your PHP programming skills to the next level!

In this concise, hands-on tutorial, PHP expert Christopher Cosentino delivers dozens of powerful new techniques for building serious Web applications. Through professional-quality examples drawn from his six years as a PHP developer, Cosentino walks you through building friendlier, more usable sites; improving user authentication; generating dynamic graphics; parsing XML documents; building database-independent Web applications; and much more!

Take PHP to the limit... and beyond!

  • Manage sessions more effectively
  • Interact with multiple databases via PEAR::DB
  • Improve your form processing scripts
  • Parse large files and perform data mining
  • Authenticate users by IP address, database query, or HTTP authentication
  • Create custom error handlers
  • Dump database contents into XML files
  • Use PHP-GTK to build client-side cross-platform GUI applications
  • And more...



Download the zipped archive of Source Code For All Chapters.

Sample Content

Online Sample Chapters

Multiple Database Interaction in PHP 4.1

PHP Authentication Schemes

Table of Contents


Goal Of This Book.

Who This Book Is For.

Getting The Code.


The Fine Print.

1. PHP Review.

Overview. PHP Syntax. Operators. Arithmetic Operators. Assignment Operators. Comparison Operators. Concatenating Strings. Arrays. If/Then Statements. Switch Statements. For Loops. Foreach Loops. While Loops. Do While Loops. User-defined Functions. Object Oriented Programming With PHP. phpinfo(). Additional Resources.

2. Session Management.

Introduction to Session Management in PHP4. Initial php.ini Settings For Session Management. On Windows. On Linux. General Considerations. Starting a Session. The Contents of Session Files. Tracking Variables Across Pages During A Session. Unregistering Session Variables. Destroying Sessions. A Simple Session-based Shopping Cart.

3. Multi-database Interaction.

Advanced Database Interaction in PHP4. Database Specific Functions In PHP. Connecting To The Database Server. Selecting The Proper Database. Querying The Database To Insert, Read, Or Delete Data. Obtaining The Results Of Your Queries To Present To The User. DBX - PHP Support For Multiple Databases. You can verify the DBX has been correctly installed by using the phpinfo()function and verifying DBX is listed under the configuration section. Enabling DBX in Windows. DBX Functions. BX Functions. Using DBX. Creating Your Own Support For Multiple Databases. Using Pear::DB. Downloading PEAR. Downloading PEAR from CVS. Back To The Basics.

4. Better Form Processing.

Introduction to Better Forms. Post and Get. Making Forms Friendly. Souping-up the script. Check For Spaces. Check For Minimum Number Of Characters. Add More Error Information. Form-Field Checking. Checking For Valid Email Addresses. Using $HTTP_GET_VARS and $HTTP_POST_VARS. Putting It All Together. Variable Variables.

5. Using What You Have Learned — A Simple Shopping Cart.

Introduction. Features Of The Shopping Cart. Simple Shopping Interface. Simple Administration And Management Interfaces. Setting It Up. The Code. cart.sql. cart.php. cart_inc.php. dbmanage.php. admin.php. checkout.php. finishorder.php.

6. Working With Files.

Overview. Opening Files. Reading Files. Closing Files. Putting It To Use. Data Mining. Parsing Large Files.

7. PHP Authentication Schemes.

User Authentication Overview. Generating Passwords. Authenticating Users Against Text Files. Authenticating Users By IP Address. Authenticating Users Using HTTP Authentication. Authenticating Users By Database Query.

8. Error Management.

Overview. Error Reporting. Types Of Errors In PHP. Error Reporting Settings In php.ini. error_reporting(). php.ini Setting: display_errors. php.ini Settings For Development & Testing. Logging Errors. Custom Error Handlers. Triggering Errors 251. Tracking User Logins.

9. Using What You Have Learned — A Meeting Tracker Application.

Introduction. Simple Administration Interface. Setting It Up. The Code. meeting.sql. meeting.php. meeting_inc.php. admin.php.

10. PHP and XML.

Overview. Creating An XML Parser. Defining the XML Parser. Defining The Element Handlers. Defining Character Handlers. Starting The Parser. Cleaning Up. Parsing and Transforming XML Documents. Dumping Database Contents Into An XML File.

11. Generating Dynamic Graphics With PHP.

Overview. The GD Library. Enabling GD support. Enabling GD For Windows. Enabling GD for Linux. Generating Graphics with GD. The Lines and Text. Adding TrueType Font To Your Images. Adding Text To Base Images. Creating Rectangles with GD.


Introduction to PHPGTK. Installing PHPGTK. Before You Install. Installing on Windows. Installing on Linux. Creating Basic GTK Objects. Creating Your First PHPGTK Window. Adding a GTK Button. Modifying Basic Widget Appearance. Text Entry. hbox and vbox. pack_start. Putting It All Together. Dialog Boxes. A Simple PHPGTK Application.



Goal of This Book

The goal of this book is to help you get a better grasp of PHP, to learn some of the less commonly used features, and to help you build some applications that are useful in your work or hobbies. I hope it gives you some ideas on how to make your own applications easier to code and easier to use.

Who This Book Is For

This book is for those who have done some basic PHP programming and wish to learn about some of the more advanced techniques to make applications easier to use and easier to program.

I received many emails from across the globe from readers of my first book, Essential PHP for Web Professionals (also published by Prentice Hall), who liked the concise style and ample examples I had provided. I received literally dozens of emails from people who said they had read other PHP programming books, but they didn’t really grasp how PHP worked until they read my book. I can’t tell you how happy that makes me feel. I hope to do the same with this book.

This book is for those of you who are ready to take the next step and learn a little more about PHP. This book isn’t a reference book, nor does it cover every advanced aspect of PHP. It does, however, stretch beyond the basics and introduce some more concepts that can help you with your PHP programming.

Getting the Code

All of the code for this book is available on the Advance Web Series Web page (www.phptr.com/advancedweb/php).

You can download all of the examples for each chapter on the page.

The Web page will also have any updates or errata, as well as answers to frequently asked questions.


Submit Errata

More Information

Unlimited one-month access with your purchase
Free Safari Membership