Home > Store

Core Web Application Development with PHP and MySQL

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

Core Web Application Development with PHP and MySQL

Book

  • Sorry, this book is no longer in print.
Not for Sale

About

Features

An end-to-end guide to building industrial-strength web applications: includes PHP/MySQL source code to three complete web applications.

° Successful Core Series format applied to PHP and MySQL

° Much more than exploring PHP syntax, this book shows developers how to build

real-world, mission-critical web applications - and includes fully-tested source code

to three complete web applications.

° Also shows how to use Oracle and PostgresSQL with PHP: two powerful databases

favored in mission-critical settings.

Description

  • Copyright 2006
  • Dimensions: 7" x 9-1/4"
  • Pages: 888
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-186716-4
  • ISBN-13: 978-0-13-186716-1

The programmer's Guide to building robust web applications with PHP and MySQL

This is a comprehensive, practical guide for programmers who want to develop production-quality, database-enabled web applications with PHP and MySQL. Long-time developer Marc Wandschneider systematically addresses the entire process: not only coding, but also upfront application, user interface and database design, PLUS security, testing, and more.

You'll walk through building three applications from start to finish: a calendaring system, a weblog engine, and an e-commerce store. Along the way, you'll master essential strategies for creating robust web database applications and learn how to avoid the common pitfalls that trip up many developers moving to PHP and MySQL.

  • Starts with a complete primer on PHP for developers including coverage of code organization, reuse, and object-oriented PHP
  • Contains detailed treatments of data access, including transactions, foreign keys, and indexes
  • Presents powerful data validation techniques utilizing PHP regular expressions
  • Walks through planning web applications, including user interfaces and user management
  • Offers systematic guidance on securing web applications from end to end
  • Covers a wide range of implementation issues including internationalization, error handling, data validation, debugging, session management, and deployment
  • Includes detailed chapters on XML, XML-based web services, and the PEAR framework for reusable PHP components
  • Shows how to work with the Oracle and PostgreSQL databases

Sample Content

Table of Contents

Introduction.

I. THE BASICS OF PHP.

1. Getting Started with PHP.

2. The PHP Language.

3. Code Organization and Reuse.

4. Object-Oriented Programming.

5. Working with Arrays.

6. Strings and Characters of the World.

7. Interacting with the Server: Forms.

II. DATABASE BASICS.

8. Introduction to Databases.

9. Designing and Creating Your Database.

10. Using Databases: Storing and Retrieving Data.

11. Using Databases: Advanced Data Access.

12. PHP and Data Access.

III. PLANNING WEB APPLICATIONS.

13. Web Applications and the Internet.

14. Implementing a User Interface.

15. User Management.

16. Securing Your Web Applications:  Planning and Code Security.

17. Securing Your Web Applications:  Software and Hardware Security.

IV. IMPLEMENTING YOUR WEB APPLICATION.

18. Error Handling and Debugging.

19. Cookies and Sessions.

20. User Authentication.

21. Advanced Output and Output Buffering.

22. Data Validation with Regular Expressions.

23. XML and XHTML.

24. Files and Directories.

25. File Uploading.

26. Working with Dates and Times.

27. XML Web Services and SOAP.

28. Using PEAR.

29. Development and Deployment.

V. SAMPLE PROJECTS AND FURTHER IDEAS.

30. Strategies for Successful Web Applications.

31. An Appointment Manager.

32. A Blogging Engine.

33. An Ecommerce Application.

VI. APPENDIXES.

Appendix A. Installation/Configuration.

Appendix B. Database Function Equivalents.

Appendix C. Recommended Reading.

Index.

Preface

Untitled Document This is the book I wish I had a couple years ago when I sat down and decided to learn something about web applications. The transition from programming standard window-system GUI applications to writing dynamic web applications was surprisingly complicated. Extremely productive languages such as PHP make the transition easier, but the learning curve remains steep.

With that in mind, I sat down to write this book and explain how to use the various technologies that go into writing web applications. I have made every mistake possible while learning about PHP and databases, and have therefore tried to incorporate as much of what I learned into this book. Far too many books published these days are merely a reprint of existing documentation or UNIX man pages, and I truly wanted to see something different in print.

The technologies, however, are only half the battle. Without strategies or systematic approaches to design and implementation, applications are doomed to an expensive and messy existence at best—or failure at worst. Therefore, this book focuses on a lot of things you might not see covered to the same extent in other books—design, testing, and security.

Target Audience

This book is targeted at people who need or want to write a web application. You might be a corporate developer looking to build an intranet application for your company or an Internet web application for customers. You might be a consultant helping a small business develop a web store, or just a hobbyist looking to learn more about web applications and write one of your own.

The assumption is that you have at least a passing familiarity with programming, although this book by no means expects you to be an expert. An understanding of basic programming constructs, such as variables and functions, and a basic understanding of HTML should be more than sufficient.

Because I knew next to nothing about databases when I started learning about web application programming, I likewise expect no more of the reader. This book covers databases from basic terminology and design to basic and advanced queries, with an appropriate balance between clear-and-simple instruction and interesting examples to help you in your development.

About PHP

PHP began in 1994 as a series of scripts called PHP/FI (Personal Home Page/Forms Interpreter), and it was written by a fellow named Rasmus Lerdorf to help him manage documents on his web site. Over the years, PHP grew into something more serious. In 1997, a second version of the system came out with additional functionality.

In late 1998, PHP 3.0 was released, leading to a major rewrite of the code and the involvement of two new developers—Zeev Suraski and Andi Gutmans. The goal was to support progressively broader and more complex applications on the web. In early 2000, version 4.0 was released. Based on a new language engine called the Zend Engine, this version had much better performance and increased code modularity. By late 2004, the much-evolved version 5.0 was released. It included many new features, such as new language constructs, broader web server support, sessions, and additional third-party extensions. Among the new language features was a significantly improved and expanded object-oriented programming model, which this book uses extensively. Somewhere along the way, PHP ceased to refer to "Personal Home Page" and came to mean "PHP Hypertext Preprocessor," a so-called recursive acronym. (The acronym actually forms part of the term it defines!)

PHP is a remarkably productive language—you can sit down and crank out (yes, that's the technical term) large amounts of code in a short period of time, and this productivity is what drew me to it some years back. With PHP, I was able to put together surprisingly robust and dynamic travelogues of my journeys to various countries with relatively little code.

The one possible "fly in the ointment" is that the language can be quirky compared to other programming languages—especially if you, like me, come from a background of languages more similar to C/C++, Java, or Visual BASIC. In fact, many of the things covered in this book are the result of my sitting around and scratching my head for a couple of hours. However, after you become comfortable with it, the language proves fun to write and is surprisingly powerful.

Layout

This book is divided into six parts, which represents the logical progression of writing web applications.

Part I, "The Basics of PHP," covers the PHP language itself, starting with descriptions and discussions of the most basic types of language. Part I then moves on to functions, code structure, and object-oriented programming—before finishing off with a discussion of arrays and strings.

Part II, "Database Basics," covers databases, starting with terminology and progressing through design and data definition. Part II finishes by describing the use of databases and tables, ranging from the most basic queries to transactions and functions.

Part III, "Planning Web Applications," takes a step back from coding to discuss the design of your web applications. Many people get so involved in writing their code that they forget to sit down and actually think about it in advance. These chapters (hopefully) give you something to think about as you begin. This part also focuses heavily on securing your applications, as it is not something to be taken lightly.

Part IV, "Implementing Your Web Application," discusses the more advanced language features and concepts required to move beyond simple PHP and databases into writing web applications, covering topics such as errors, sessions, and XML—including plenty of sample code.

Part V, "Sample Projects and Further Ideas," presents three full web application samples that start with a simple appointment management system, progress through a web log system, and finish with an ecommerce store. These samples incorporate much of what the book has covered and are designed to be robust. Instead of killing large numbers of trees and listing all the code for the samples, you can download and run them. The book shows you only the most salient sections of the code and leaves you to download and run them in completion.

Part VI, "Appendixes," discusses the installation of the necessary software to run your web applications and how to perform various database actions on different database engines, and suggests some additional reading material.

Before You Begin

Before you begin reading the meat of this book, please take a moment to open the CD that accompanies this book and copy the source code to your computer. The phpwasrc/ directory contains the initial files you need.

In addition to the full source code (and installation instructions) for the three large samples from Part V of the book, there are also small snippets of code to accompany many of the chapters in the book. You can run these, debug them, or change and play with them to further help you learn how the language works.

Beyond the sample sources, the CD contains versions of PHP, the Apache HTTP Server, and MySQL that you can use to install the software on your local machine. Instructions are included on the CD.


Index

Download the Index file related to this title.

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020