Muutke küpsiste eelistusi

PHP and MySQL Web Development 4th edition [Multiple-component retail product]

3.96/5 (1093 hinnangut Goodreads-ist)
  • Formaat: Multiple-component retail product, 1008 pages, kõrgus x laius x paksus: 231x181x53 mm, kaal: 1576 g, Contains 1 Paperback / softback and 1 CD-ROM
  • Ilmumisaeg: 09-Oct-2008
  • Kirjastus: Addison-Wesley Educational Publishers Inc
  • ISBN-10: 0672329166
  • ISBN-13: 9780672329166
  • Multiple-component retail product
  • Hind: 65,34 €*
  • * saadame teile pakkumise kasutatud raamatule, mille hind võib erineda kodulehel olevast hinnast
  • See raamat on trükist otsas, kuid me saadame teile pakkumise kasutatud raamatule.
  • Kogus:
  • Lisa ostukorvi
  • Tasuta tarne
  • Lisa soovinimekirja
  • Formaat: Multiple-component retail product, 1008 pages, kõrgus x laius x paksus: 231x181x53 mm, kaal: 1576 g, Contains 1 Paperback / softback and 1 CD-ROM
  • Ilmumisaeg: 09-Oct-2008
  • Kirjastus: Addison-Wesley Educational Publishers Inc
  • ISBN-10: 0672329166
  • ISBN-13: 9780672329166
PHP and MySQL Web Development, Fourth Edition The definitive guide to building database-drive Web applications with PHP and MySQL

PHP and MySQL are popular open-source technologies that are ideal for quickly developing database-driven Web applications. PHP is a powerful scripting language designed to enable developers to create highly featured Web applications quickly, and MySQL is a fast, reliable database that integrates well with PHP and is suited for dynamic Internet-based applications.







PHP and MySQL Web Development shows how to use these tools together to produce effective, interactive Web applications. It clearly describes the basics of the PHP language, explains how to set up and work with a MySQL database, and then shows how to use PHP to interact with the database and the server.











This practical, hands-on book includes numerous examples that demonstrate common tasks such as authenticating users, constructing a shopping cart, generating PDF documents and images dynamically, sending and managing email, facilitating user discussions, connecting to Web services using XML, and developing Web 2.0 applications with Ajax-based interactivity.











The fourth edition of PHP and MySQL Web Development has been thoroughly updated, revised, and expanded to cover developments in PHP 5 through version 5.3, such as namespaces and closures, as well as features introduced in MySQL 5.1.



TABLE OF CONTENTS

Part I: Using PHP 1 PHP Crash Course 2 Storing and Retrieving Data 3 Using Arrays 4 String Manipulation and Regular Expressions 5 Reusing Code and Writing Functions 6 Object-Oriented PHP 7 Error and Exception Handling

Part II: Using MySQL 8 Designing Your Web Database 9 Creating Your Web Database 10 Working with Your MySQL Database 11 Accessing Your MySQL Database from the Web with PHP 12 Advanced MySQL Administration 13 Advanced MySQL Programming

Part III: E-Commerce and Security 14 Running an E-Commerce Site 15 E-commerce Security Issues 16 Web Application Security 17 Implementing Authentication with PHP and MySQL 18 Implementing Secure Transactions with PHP and MySQL

Part IV: Advanced PHP Techniques 19 Interacting with the File System and the Server 20 Using Network and Protocol Functions 21 Managing the Date and Time 22 Generating Images 23 Using Session Control in PHP 24 Other Useful Features

Part V: Building Practical PHP and MySQL Projects 25 Using PHP and MySQL for Large Projects 26 Debugging 27 Building User Authentication and Personalization 28 Building a Shopping Cart 29 Building a Web-Based Email Service 30 Building a Mailing List Manager 31 Building Web Forums 32 Generating Personalized PDF Documents 33 Connecting to Web Services with XML and SOAP 34 Building Web 2.0 Applications with Ajax

Part VI: Appendixes Appendix A: Installing PHP and MySQL Appendix B: Web Resources

Arvustused

This book by Welling & Thomson is the only one which I have found to be indispensable.The writing is clear and straightforward but never wastes my time.The book is extremely well laid out.The chapters are the right length and chapter titles quickly take you where you want to go. Wright Sullivan, President,A&E Engineering, Inc., Greer South Carolina

There are several good introductory books on PHP, but Welling & Thomson is an excellent handbook for those who wish to build up complex and reliable systems. Its obvious that the authors have a strong background in the development of professional applications and they teach not only the language itself, but also how to use it with good software engineering practices. Javier Garcia, senior telecom engineer, Telefonica R&D Labs, Madrid

This book rocks! I am an experienced programmer, so I didnt need a lot of help with PHP syntax; after all, its very close to C/C++. I dont know a thing about databases, though, so when I wanted to develop a book review engine (among other projects) I wanted a solid reference to using MySQL with PHP. I have OReillys mSQL and MySQL book, and its probably a better pure-SQL reference, but this book has earned a place on my reference shelfHighly recommended. Paul Robichaux

The true PHP/MySQL bible, PHP and MySQL Web Development by Luke Welling and Laura Thomson, made me realize that programming and databases are now available to the commoners. Again, I know 1/10000th of what there is to know, and already Im enthralled. Tim Luoma,TnTLuoma.com

Muu info

PHP and MySQL Web Development teaches you to develop dynamic, secure, commercial Web sites. Using the same accessible, popular teaching style of the three previous editions, this book has been thoroughly updated to reflect the rapidly changing landscape of MySQL and PHP. The fourth edition of PHP and MySQL Web Development includes updated examples and coverage of recent versions of PHP, through PHP 5.3, as well as new coverage of PHP security and Web 2.0 social networks.
Introduction 1(12)
I Using PHP
PHP Crash Course
13(46)
Before You Begin: Accessing PHP
14(1)
Creating a Sample Application: Bob's Auto Parts
14(3)
Creating the Order Form
14(2)
Processing the Form
16(1)
Embedding PHP in HTML
17(4)
PHP Tags
18(1)
PHP Statements
19(1)
Whitespace
20(1)
Comments
20(1)
Adding Dynamic Content
21(2)
Calling Functions
22(1)
Using the date () Function
22(1)
Accessing Form Variables
23(5)
Short, Medium, and Long Variables
23(3)
String Concatenation
26(1)
Variables and Literals
27(1)
Understanding Identifiers
28(1)
Examining Variable Types
29(2)
PHP's Data Types
29(1)
Type Strentht
29(1)
Type Casting
30(1)
Variable Variables
30(1)
Declaring and Using Constants
31(1)
Understanding Variable Scope
31(1)
Using Operators
32(9)
Arithmetic Operators
33(1)
String Operators
34(1)
Assignment Operators
34(2)
Comparison Operators
36(2)
Logical Operators
38(1)
Bitwise Operators
38(1)
Other Operators
39(2)
Working Out the Form Totals
41(1)
Understanding Precedence and Associativity
42(2)
Using Variable Functions
44(2)
Testing and Setting Variable Types
44(1)
Testing Variable Status
45(1)
Reinterpreting Variables
46(1)
Making Decisions with Conditionals
46(5)
if Statements
46(1)
Code Blocks
47(1)
else Statements
47(1)
elseif Statements
48(1)
switch Statements
49(2)
Comparing the Different Conditionals
51(1)
Repeating Actions Through Iteration
51(5)
while Loops
53(1)
for and foreach Loops
54(1)
do...while Loops
55(1)
Breaking Out of a Control Structure or Script
56(1)
Employing Alternative Control Structure Syntasx
56(1)
Using declare
57(1)
Next
57(2)
Storing and Retrieving Data
59(22)
Saving Data for Later
59(1)
Storing and Retrieving Bob's Orders
60(1)
Processing Files
61(1)
Opening a File
61(6)
Choosing File Modes
61(1)
Using fopen () to Open a File
62(2)
Opening Files Through FTP or HTTP
64(1)
Addressing Problems Opening Files
65(2)
Writing to a File
67(2)
Parameters for fwrite ()
68(1)
File Formats
68(1)
Closing a File
69(2)
Reading from a File
71(5)
Opening a File for Reading: fopen()
72(1)
Knowing When to Stop: feof()
73(1)
Reading a Line at a Time: fgets(), fgetss(), and fgetcsv()
73(1)
Reading the Whole File: readfile(), fpassthru(), and file()
74(1)
Reading a Character: fgetc()
75(1)
Reading an Arbitrary Length: fread()
75(1)
Using Other Useful File Functions
76(2)
Checking Whether a File Is There: file_exists()
76(1)
Determining How Big a File Is: filesize()
76(1)
Deleting a File: unlink()
76(1)
Navigating Inside a File: rewind(), fseek(), and ftell()
76(2)
Locking Files
78(1)
A Better Way: Database Management Systems
79(1)
Problems with Using Flat Files
79(1)
How RDBMSs Solve These Problems
80(1)
Further Reading
80(1)
Next
80(1)
Using Arrays
81(26)
What Is an Array?
81(1)
Numerically Indexed Arrays
82(3)
Initializing Numerically Indexed Arrays
82(1)
Accessing Array Contents
83(1)
Using Loops to Access the Array
84(1)
Arrays with Different Indices
85(2)
Initializing an Array
85(1)
Accessing the Array Elements
85(1)
Using Loops
85(2)
Array Operators
87(1)
Multidimensional Arrays
88(4)
Sorting Arrays
92(1)
Using Sort()
92(1)
Using asort() and ksort() to Sort Arrays
93(1)
Sorting in Reverse
93(1)
Sorting Multidimensional Arrays
93(3)
User-Defined Sorts
93(2)
Reverse User Sorts
95(1)
Reordering Arrays
96(2)
Using shuffle()
96(1)
Using array_reverse()
97(1)
Loading Arrays from Files
98(4)
Performing Other Arrays Manipulations
102(4)
Navigating Within an Array: each(), current(), reset(), end(), next(), pos(), and prev()
102(1)
Applying Any Function to Each Element in an Array: array_walk()
103(1)
Counting Elements in an Array: count(), sizeof(), and array_count_values()
104(1)
Converting Arrays to Scalar Variables: extract()
105(1)
Further Reading
106(1)
Next
106(1)
String Manipulation and Regular Expressions
107(26)
Creating a Sample Application: Smart Form Mail
107(3)
Formatting Strings
110(6)
Trimming Strings: chop(), Itrim(), and trim()
110(1)
Formatting Strings for Presentation
110(4)
Formatting Strings for Storage: addslashes() and stripslashes()
114(2)
Joining and Splitting Strings with String Functions
116(3)
Using explode(), implode(), and join()
116(1)
Using strtok()
117(1)
Using substr()
118(1)
Comparing Strings
119(1)
Performing String Ordering: strcmp(), strcasecmp(), and strnatcmp()
119(1)
Testing String Length with strlen()
120(1)
Matching and Replacing Substrings with string Functions
120(3)
Finding Strings in Strings: strstr(), strchr(), strrchr(), and stristr()
120(1)
Finding the Position of a Substring: strpos() and strrpos()
121(1)
Replacing Substrings: str_replace() and substr_replace()
122(1)
Introducing Regular Expressions
123(6)
The Basics
124(1)
Character Sets and Classes
124(2)
Repetition
126(1)
Subexpressions
126(1)
Counted Subexpressions
126(1)
Anchoring to the Beginning or End of a String
126(1)
Branching
127(1)
Matching Literal Special Characters
127(1)
Reviewing the Special Characters
127(1)
Putting It All Together for the Smart Form
128(1)
Finding Substrings with Regular Expressions
129(1)
Replacing Substrings with Regular Expressions
130(1)
Splitting Strings with Regular Expressions
130(1)
Further Reading
131(1)
Next
131(2)
Reusing Code and Writing Functions
133(26)
The Advantages of Reusing Code
133(1)
Cost
134(1)
Reliability
134(1)
Consistency
134(1)
Using require() and include()
134(9)
Filename Extensions and require()
135(2)
Using require() for Website Templates
137(5)
Using auto_prepend_file and auto_append_file
142(1)
Using Functions in PHP
143(3)
Calling Functions
143(2)
Calling an Undefined Function
145(1)
Understanding Case and Function Names
146(1)
Defining Your Own Functions
146(1)
Examining Basic Function Structure
146(2)
Naming Your Function
147(1)
Using Parameters
148(2)
Understanding Scope
150(3)
Passing by Reference Versus Passing by Value
153(1)
Using the return Keyword
154(2)
Returning Values from Functions
155(1)
Implementing Recursion
156(2)
Namespaces
158(1)
Further Reading
158(1)
Next
158(1)
Object-Oriented PHP
159(34)
Understanding Object-Oriented Concepts
160(2)
Classes and Objects
160(1)
Polymorphism
161(1)
Inheritance
162(1)
Creating Classes, Attributes, and Operations in PHP
162(2)
Structure of a Class
162(1)
Constructors
163(1)
Destructors
163(1)
Instantiating Classes
164(1)
Using Class Attributes
164(2)
Controlling Access with private and public
166(1)
Calling Class Operations
167(1)
Implementing Inheritance in PHP
168(6)
Controlling Visibility Through Inheritance with private and protected
169(1)
Overriding
170(2)
Preventing Inheritance and Overriding with final
172(1)
Understanding Multiple Inheritance
173(1)
Implementing Interfaces
173(1)
Designing Classes
174(1)
Writing the Code for Your Class
175(8)
Understanding Advanced Object-Oriented Functionality in PHP
183(8)
Using Per-Class Constants
184(1)
Implementing Static Methods
184(1)
Checking Class Types and Type Hinting
184(1)
Late Static Bindings
185(1)
Cloning Objects
186(1)
Using Abstract Classes
186(1)
Overloading Methods with ___call()
186(1)
Using___autoload()
187(1)
Implementing Iterators and Iteration
188(2)
Converting Your Classes to Strings
190(1)
using the Reflection API
190(1)
Next
191(2)
Error and Exception Handling
193(14)
Exception Handling Concepts
193(2)
The Exception class
195(1)
User-Defined Exceptions
196(3)
Exceptions in Bob's Auto Parts
199(3)
Exceptions and PHP's Other Error Handling Mechanisms
202(1)
Further Reading
203(1)
Next
203(4)
II Using MySQL
Designing Your Web Database
207(12)
Relational Database Concepts
208(3)
Tables
208(1)
Columns
209(1)
Rows
209(1)
Values
209(1)
Keys
209(1)
Schemas
210(1)
Relationships
211(1)
Designing Your Web Database
211(5)
Think About the Real-World Objects You Are Modeling
211(1)
Avoid Storing Redundant Data
212(2)
Use Atomic Column Values
214(1)
Choose Sensible Keys
215(1)
Think About What You Want to Ask the Database
215(1)
Avoid Designs with Many Empty Attributes
215(1)
Summary of Table Types
216(1)
Web Database Architecture
216(2)
Further Reading
218(1)
Next
218(1)
Creating Your Web Database
219(24)
Using the MySQL Monitor
220(1)
Logging In to MySQL
221(1)
Creating Databases and Users
222(1)
Setting Up Users and Privileges
223(1)
Introducing MySQL's Privilege System
223(5)
Principle of Least Privilege
223(1)
User Setup: The GRANT Command
223(2)
Types and Levels of Privileges
225(2)
The REVOKE Command
227(1)
Examples Using GRANT and REVOKE
227(1)
Setting Up a User for the Web
228(1)
Using the Right Database
229(1)
Creating Database Tables
229(6)
Understanding What the Other Keywords Mean
231(1)
Understanding the Column Types
232(1)
Looking at the Database with SHOW and DESCRIBE
233(1)
Creating Indxes
234(1)
Understanding MySQL Identifiers
235(1)
Choosing Column Data Types
236(5)
Numeric Types
236(2)
Data and Time Types
238(1)
String Types
239(2)
Further Reading
241(1)
Next
241(2)
Working with Your MySQL Database
243(24)
What Is SQL?
243(1)
Inserting Data into the Database
244(2)
Retrieving Data from the Database
246(15)
Retrieving Data with Specific Criteria
248(1)
Retrieving Data from Multiple Tables
249(6)
Retrieving Data in a Particular Order
255(1)
Grouping and Aggregating Data
256(2)
choosing Which Rows to Return
258(1)
Using Subqueries
258(3)
Updating Records in the Database
261(1)
Altering Tables After Creation
261(3)
Deleting Records from the Database
264(1)
Dropping Tables
264(1)
Dropping a Whole Database
264(1)
Further Reading
265(1)
Next
265(2)
Accessing Your MySQL Database from the Web with PHP
267(20)
How Web Database Architectures Work
268(3)
Querying a Database from the Web
271(5)
Checking and Filtering Input Data
271(1)
Setting Up a Connection
272(2)
Choosing a Database to Use
274(1)
Querying the Database
274(1)
Retrieving the Query Results
275(1)
Disconnecting from the Database
276(1)
Putting New Information in the Database
276(4)
Using Prepared Statements
280(2)
Using Other PHP-Database Interfaces
282(3)
Using a Generic Database Interface: Pear MDB2
282(3)
Further Reading
285(1)
Next
285(2)
Advanced MySQL Administration
287(24)
Understanding the Privilege System in Detail
287(7)
The user Table
289(1)
The db and host Tables
290(2)
The table_priv, columns_priv, and procs priv Tables
292(1)
Access Control: How MySQL Uses the Grant Tables
293(1)
Updating Privileges: When Do Changes Take Effect?
293(1)
Making Your MySQL Database Secure
294(2)
MySQL from the Operating System's Point of View
294(1)
Passwords
295(1)
User Privileges
295(1)
Web Issues
296(1)
Getting More Information About Databases
296(8)
Getting Information with SHOW
296(3)
Getting Information About Columns with DESCRIBE
299(1)
Understanding How Queries Work with EXPLAIN
299(5)
Optimizing Your Database
304(1)
Design Optimization
304(1)
Permissions
304(1)
Table Optimization
304(1)
Using Indexes
305(1)
Using Default Values
305(1)
Other Tips
305(1)
Backing Up Your MySQL Database
305(1)
Restoring Your MySQL Database
306(1)
Implementing Replication
306(3)
Setting Up the Master
307(1)
Performing the Initial Data Transfer
307(1)
Setting Up the Slave or Slaves
308(1)
Further Reading
309(1)
Next
309(2)
Advanced MySQL Programming
311(16)
The LOAD DATA INFILE Statement
311(1)
Storage Engines
312(1)
Transactions
313(2)
Understanding Transaction Definitions
313(1)
Using Transactions with InnoDB
314(1)
Foreign Keys
315(1)
Stored Procedures
316(7)
Basic Example
316(3)
Local Variables
319(1)
Cursors and Control Structures
319(4)
Further Reading
323(1)
Next
323(4)
III E-commerce and Security
Running an E-commerce Site
327(14)
Deciding What You Want to Achieve
327(1)
Considering the Types of Commercial Websites
327(9)
Publishing Information using Online Brochures
328(3)
Taking Orders for Goods or Services
331(3)
Providing Services and Digital Goods
334(1)
Adding Value to Goods or Services
335(1)
Cutting Costs
335(1)
Understanding Risks and Threats
336(3)
Crackers
337(1)
Failure to Attract Sufficient Business
337(1)
Computer Hardware Failure
337(1)
Power, Communication, Network, or Shipping Failures
338(1)
Extensive Competition
338(1)
Software Errors
338(1)
Evolving Governmental Policies and Taxes
339(1)
System Capacity Limits
339(1)
Choosing a Strategy
339(1)
Next
339(2)
E-commerce Security Issues
341(20)
How Important Is Your Information?
342(1)
Security Threats
342(7)
Exposure of Confidential Data
343(1)
Loss or Destruction of Data
344(1)
Modification of Data
345(1)
Denial of Service
346(1)
Errors in Software
347(1)
Repudiation
348(1)
Usability, Performance, Cost, and Security
349(1)
Creating a Security Policy
349(1)
Authentication Principles
350(1)
Encryption Basics
351(4)
Private Key Encryption
353(1)
Public Key Encryption
353(1)
Digital Signatures
354(1)
Digital Certificates
355(1)
Secure Web Servers
356(1)
Auditing and Logging
357(1)
Firewalls
357(1)
Data Backups
358(1)
Backing Up General Files
358(1)
Backing Up and Restoring Your MySQL Database
358(1)
Physical Security
359(1)
Next
359(2)
Web Application Security
361(30)
Strategies for Dealing with Security
361(2)
Start with the Right Mindset
362(1)
Balancing Security and Usability
362(1)
Monitoring Security
363(1)
Our Basic Approach
363(1)
Identifying the Threats We Face
363(2)
Access to or Modification of Sensitive Data
363(1)
Loss or Destruction of Data
364(1)
Denial of Service
364(1)
Malicious Code Injection
365(1)
Compromised Server
365(1)
Understanding Who We're Dealing With
365(2)
Crackers
366(1)
Unwitting Users of Infected Machines
366(1)
Disgruntled Employees
366(1)
Hardware Thieves
366(1)
Ourselves
366(1)
Securing Your Code
367(11)
Filtering User Input
367(4)
Escaping Output
371(3)
Code Organization
374(1)
What Goes in Your Code
374(1)
File System Considerations
375(1)
Code Stability and Bugs
376(1)
Execution Quotes and exec
377(1)
Securing Your Web Server and PHP
378(5)
Keep Software Up-to-Date
378(2)
Browse the php.ini file
380(1)
Web Server Configuration
380(2)
Commercially Hosted Web Applications
382(1)
Database Server Security
383(2)
Users and the Permissions System
383(1)
Sending Data to the Server
384(1)
Connecting to the Server
384(1)
Running the Server
385(1)
Protecting the Network
385(2)
Install Firewalls
386(1)
Use a DMZ
386(1)
Prepare for DoS and DDoS Attacks
387(1)
Computer and Operating System Security
387(1)
Keep the Operating System Up-to-Date
387(1)
Run Only What Is Necessary
388(1)
Physically Secure the Server
388(1)
Disaster Planning
388(2)
Next
390(1)
Implementing Authentication with PHP and MySQL
391(18)
Identifying Visitors
391(1)
Implementing Access Control
392(7)
Storing Passwords
395(2)
Encrypting Passwords
397(2)
Protecting Multiple Pages
399(1)
Using Basic Authentication
399(1)
Using Basic Authentication in PHP
400(2)
Using Basic Authentication with Apache's .htaccess Files
402(4)
Using mod_auth_mysql Authentication
406(2)
Installing mod_auth_mysql
406(1)
Using mod_auth_mysql
407(1)
Creating Your Own Custom Authentication
408(1)
Further Reading
408(1)
Next
408(1)
Implementing Secure Transactions with PHP and MySQL
409(22)
Providing Secure Transactions
409(4)
The User's Machine
410(1)
The Internet
411(1)
Your System
412(1)
Using Secure Sockets Layer (SSL)
413(4)
Screening User Input
417(1)
Providing Secure Storage
417(2)
Storing Credit Card Numbers
419(1)
Using Encryption in PHP
419(8)
Installing GPG
420(2)
Testing GPG
422(5)
Further Reading
427(1)
Next
428(3)
IV Advanced PHP Techniques
Interacting with the File System and the Server
431(20)
Uploading Files
431(8)
HTML for File Upload
433(1)
Writing the PHP to Deal with the File
434(4)
Avoiding Common Upload Problems
438(1)
Using Directory Functions
439(4)
Reading from Directories
439(3)
Getting Information About the current Directory
442(1)
Creating and Deleting Directories
443(1)
Interacting with the File System
443(4)
Getting File Information
444(2)
Changing File Properties
446(1)
Creating, Deleting, and Moving Files
447(1)
Using Program Execution Functions
447(3)
Interacting with the Environment: getenv() and putenv()
450(1)
Further Reading
450(1)
Next
450(1)
Using Network and Protocol Functions
451(18)
Examining Available Protocols
451(1)
Sending and Reading Email
452(1)
Using Data from Other Websites
452(3)
Using Network Lookup Functions
455(4)
Backing Up or Mirroring a File
459(9)
Using FTP to Back Up or Mirror a File
459(7)
Uploading Files
466(1)
Avoiding Timeouts
467(1)
Using Other FTP Functions
467(1)
Further Reading
468(1)
Next
468(1)
Managing the Data and Time
469(14)
Getting the Date and Time from PHP
469(7)
Using the date() Function
469(2)
Dealing with Unix Timestamps
471(2)
Using the getdate() Function
473(1)
Validating Dates with checkdate()
474(1)
Formatting Timestamps
474(2)
Converting Between PHP and MySQL Date Formates
476(1)
Calculating Dates In PHP
477(1)
Calculating Dates In MySQL
478(2)
Using Microseconds
480(1)
Using the Calendar Functions
480(1)
Further Reading
481(1)
Next
481(2)
Generating Images
483(26)
Setting Up Image Support in PHP
484(1)
Understanding Image Formats
484(2)
JPEG
485(1)
PNG
485(1)
WBMP
485(1)
GIF
485(1)
Creating Images
486(4)
Creating a Canvas Image
487(1)
Drawing or Printing Text on the Image
487(2)
Outputting the Final Graphic
489(1)
Cleaning Up
490(1)
Using Automatically Generated Images in Other Pages
490(1)
Using text and Fonts to Create Images
491(8)
Setting Up the Base Canvas
495(1)
Fitting the text onto the Button
495(3)
Positioning the Text
498(1)
Writing the Text onto the Button
499(1)
Finishing Up
499(1)
Drawing Figures and Graphing Data
499(8)
Using Other Image Functions
507(1)
Further Reading
507(1)
Next
508(1)
Using Session Control in PHP
509(16)
What is Session Control?
509(1)
Understanding Basic Session Functionality
509(3)
What is a Cookie?
510(1)
Setting Cookies from PHP
510(1)
Using Cookies with Sessions
511(1)
Storing the session ID
511(1)
Implementing Simple Sessions
512(2)
Starting a Session
512(1)
Registeromg Session Variables
513(1)
Using Session Variables
513(1)
Unsetting Variables and Destroying the Session
513(1)
Creating a Simple Session Example
514(2)
Configuring Session Control
516(1)
Implementing Authentication with Session Control
517(7)
Further Reading
524(1)
Next
524(1)
Other Useful Features
525(10)
Evaluating Strings: eval()
252(274)
Terminating Execution; die() and exit(0
526(1)
Serializing Variables and Objects
526(2)
Getting Information about the PHP Environment
528(1)
Finding Out What Extensions Are Loaded
528(1)
Identifying the Script Owner
529(1)
Finding Out When the Script Was Modified
529(1)
Temporarily Altering the Runtime Environment
529(1)
Highlighting Source Code
530(1)
Using PHP on the Command Line
531(1)
Next
532(3)
V Building Practical PHP and MySQL Project
Using PHP and MySQL for Large Projects
535(16)
Applying Software Engineering to Web Development
536(1)
Planning and Running a Web Application Project
536(1)
Reusing Code
537(1)
Writing Maintainable Code
538(4)
Coding Standards
538(3)
Breaking Up code
541(1)
Using a Standard Directory Structure
542(1)
Documenting and Sharing In-House Functions
542(1)
Implementing Version Control
542(2)
Choosing a Devleopment Environment
544(1)
Documenting Your Project
544(1)
Prototyping
545(1)
Separating Logic and Content
546(1)
Optimizing Code
546(2)
Using Simple Optimizations
547(1)
Using Zend products
547(1)
Testing
548(1)
Further Reading
549(1)
Next
549(2)
Debugging
551(18)
Progarmming Errors
551(8)
Syntax Errors
552(1)
Runtime Errors
552(6)
Logic Errors
558(1)
Variable Debugging Aid
559(3)
Error Reporting Levels
562(1)
Altering the Error Reporting Settings
563(1)
Triggering Your Own Errors
564(1)
Handling Errors Gracefully
565(2)
Next
567(2)
Building User Authentication and Personalization
569(38)
Solution Components
569(2)
User Identification and Personalization
570(1)
Storing Bookmarks
571(1)
Recommending Bookmarks
571(1)
Solution Overview
571(2)
Implementing the Database
573(1)
Implementing the Basic Site
574(3)
Implementing User Authentication
577(19)
Registering Users
577(7)
Logging In
584(3)
Loggign Out
587(1)
Changing Passwords
588(3)
Resetting Forgotten Passwords
591(5)
Implementing Bookmark Storage and Retrieval
596(6)
Adding Bookmarks
596(3)
Displaying Bookmarks
599(1)
Deleting Bookmarks
600(2)
Implementing Recommendations
602(4)
Considering Possible Exteneions
606(1)
Next
606(1)
Building a Shooping cart
607(44)
Solution Components
607(2)
Building an Online Catalog
608(1)
Tracking User's Purchases While They Shop
608(1)
Implementing a Payment System
608(1)
Building an Administration Interface
609(1)
Solution Overview
609(3)
Implementing the Database
612(3)
Implementing the Online Catalog
615(8)
Listing categories
617(3)
Listign Books in a Category
620(2)
Showing Book Details
622(1)
Implementing the Shopping Cart
623(16)
Using the Show_cart.php Script
623(4)
Viewing the Cart
627(3)
Adding Items to the Cart
630(1)
Saving the Updated Cart
631(1)
Printing a Header Bar Summary
632(1)
Checking Out
633(6)
Implementing Payment
639(2)
Implementing an Administration interface
641(9)
Extending the Project
650(1)
Using and Existing Systema
650(1)
Next
650(1)
Building a Web-Based Email Service
651(36)
Solution Components
651(3)
Mail Protocols: POP3 Versus IMAP
651(1)
POP3 and IMAP Support in PHP
652(16)
Solution Overview
654(1)
Setting Up the Database
655(2)
Examination the Script Architecture
657(6)
Logging In and Out
663(3)
Setting Up Accounts
666(5)
Creating a New Account
668(2)
Modifying an existing Account
670(1)
Deleting an Account
670(1)
Reading Mail
671(15)
Selecting an Account
671(3)
Viewing Mailbox Contents
674(3)
Reading a Mail Message
677(3)
Viewing Message Headers
680(2)
Deleting Mail
682(1)
Sending Mail
682(1)
Sending a New Message
682(2)
Replying to or Forwarding Mail
684(2)
Extending the Project
686(1)
Next
686(1)
Building a Mailing List Manager
687(54)
Solution Components
687(2)
Setting Up a Database of list and Subscribers
688(1)
Uploading Newsletters
688(1)
Sending Mail with Attachments
689(1)
Solution Overview
689(3)
Setting Up the Database
692(2)
Defining the Script Architecture
694(8)
Implementing Login
702(6)
Creating a New Accounta
702(3)
Logging In
705(3)
Implementing User Functions
708(13)
Viewing Lists
708(5)
Viewing List Informationa
713(3)
Viewing List Archives
716(1)
Subscribing and Unsubscribing
717(2)
Changing Account Settings
719(1)
Changing Passwards
719(2)
Logging Out
721(1)
Implementing Administrative Functions
721(19)
Creating a New List
722(2)
Uploading a New Newsletter
724(3)
Handling Multiple File Upload
727(5)
Previewing the Newsletter
732(1)
Sending the Message
733(7)
Extending the project
740(1)
Next
740(1)
Building Web Forums
741(30)
Understanding the Processa
741(1)
Solution Components
742(1)
Solution Overview
743(1)
Designing the Database
744(3)
Viewing the tree of Articles
747(13)
Expanding and Collapsinga
749(3)
Displaying the Articles
752(1)
Using the Treenode Class
753(7)
Viewing Individual Articles
760(2)
Adding New Articles
762(7)
Adding Extensions
769(1)
Using an Existing System
770(1)
Next
770(1)
Generating Personalized PDF Documents
771(36)
Project Overviewa
771(5)
Evaluating Document Formats
772(4)
Solution Components
776(2)
Questions and Answer System
776(1)
Document Generation Software
776(2)
Solution Overview
778(26)
Asking the Questions
780(2)
Grading the Answers
782(2)
Generating an RTF Centificate
784(4)
Generating a PDF certificate from a template
788(4)
Generating a PDF Document Using PDFilb
792(1)
A Hello World Script for PDflib
792(4)
Generating a certificate with PDflib
796(8)
Handling Problems with Headers
804(1)
Extending the Projecta
805(1)
Next
805(2)
Connecting to Web Services with XML and SOAP
807(48)
Project Overview: Working with XML and Web Services
807(6)
Understanding XML
808(3)
Understanding Web Services
811(2)
Solution Components
813(2)
Using Amazon's Web service Interfaces
813(1)
Parsing XML: REST Responses
814(1)
Using SOAP with PHP
814(1)
Caching
815(1)
Solution Overview
815(38)
Core Application
820(6)
Showing Books in a category
826(2)
Getting an Amazon ResultSet Class
828(10)
Using REST to Make a Request and retrieve a Result
838(7)
Using SOAP to Make a Request and Restrieve a Result
845(1)
Caching the Data from a Request
846(3)
Building the Shopping Cart
849(3)
Checking Out to Amazon
852(1)
Installing the Project Code
853(1)
Extending the Project
854(1)
Further Reading
854(1)
Building Web 2.0 Applications with Ajax
855(56)
What Is Ajax?
856(4)
HTTP Request and Responses
856(1)
DHTML and XHTML
857(1)
Cascading Style Sheets (CSS)
858(1)
Client-Side Programming
859(1)
Server-Side Programming
860(1)
XML and XSLT
860(1)
Fundamental Ajax
860(10)
The XMLHTTPRequest Object
860(2)
Communicating with the Server
862(2)
Working with the Server Response
864(2)
Putting It All Together
866(4)
Adding Ajax Elements to Earlier Projects
870(14)
Adding Ajax Elements to PHPbookmark
870(14)
For More Information
884(5)
Learning More about the Document Object Model (DOM)
884(1)
Java Script Libraries for Ajax Applications
884(1)
Ajax Developer Websites
885(4)
Appendixes
A Installing PHP and MySQL
889(18)
Installing Apache, PHP, and MySQL under Unix
890(1)
Binary Installation
890(1)
Source Installation
891(5)
httpd.conf File: Snippets
896(1)
Is PPH Support Working?
897(1)
Is SSL Working?
898(1)
Installing Apache, PHP, and MySQL Under Windows
899(1)
Installing MySQL Under Windows
900(1)
Installing Apache Under Windows
901(2)
Installing PHP for Windows
903(2)
Installing PEAR
905(1)
Setting Up Other Configurations
906(1)
B Web Resources
907(4)
PHP Resources
907(2)
MySQL and SQL Specific Resources
909(1)
Apache Resources
909(1)
Web Development
910(1)
Index 911
Lead Authors







Laura Thomson is a senior software engineer at Mozilla Corporation. She was formerly a principal at both OmniTI and Tangled Web Design, and she has worked for RMIT University and the Boston Consulting Group. She holds a Bachelor of Applied Science (Computer Science) degree and a Bachelor of Engineering (Computer Systems Engineering) degree with honors.













Luke Welling is a web architect at OmniTI and regularly speaks on open source and web development topics at conferences such as OSCON, ZendCon, MySQLUC, PHPCon, OSDC, and LinuxTag. Prior to joining OmniTI, he worked for the web analytics company Hitwise.com, at the database vendor MySQL AB, and as an independent consultant at Tangled Web Design. He has taught computer science at RMIT University in Melbourne, Australia, and holds a Bachelor of Applied Science (Computer Science) degree.











Contributing Authors







Julie C. Meloni has been developing web-based applications since the Web first saw the light of day and remembers the excitement surrounding the first GUI web browser. She has authored numerous books and articles on web-based programming languages and database topics, including the bestselling Sams Teach Yourself PHP, MySQL and Apache All in One.











Adam DeFields is a consultant specializing in web application development, project management, and instructional design. He lives in Grand Rapids, Michigan where he runs Emanation Systems, LLC, a company he founded in 2002. He has been involved with web development projects using several different technologies, but has developed a strong preference toward PHP/MySQL-based projects.











Marc Wandschneider is a freelance software developer, author, and speaker who travels the globe working on interesting projects. In recent years, a lot of his attention has been focused on writing robust and scalable web applications, and in 2005 he wrote a book called Core Web Application Programming with PHP and MySQL. He was was previously the main developer of the SWiK open source community site.