Learning PHP 5
Table of Contents
Copyright
Dedication
Preface
Who This Book Is For
Contents of This Book
Other Resources
Conventions Used in This Book
Using Code Examples
Comments and Questions
Acknowledgments
Chapter 1. Orientation and First Steps
1.1 PHP's Place in the Web World
1.2 What's So Great About PHP?
1.3 PHP in Action
1.4 Basic Rules of PHP Programs
1.5 Chapter Summary
Chapter 2. Working with Text and Numbers
2.1 Text
2.2 Numbers
2.3 Variables
2.4 Chapter Summary
2.5 Exercises
Chapter 3. Making Decisions and Repeating Yourself
3.1 Understanding true and false
3.2 Making Decisions
3.3 Building Complicated Decisions
3.4 Repeating Yourself
3.5 Chapter Summary
3.6 Exercises
Chapter 4. Working with Arrays
4.1 Array Basics
4.2 Looping Through Arrays
4.3 Modifying Arrays
4.4 Sorting Arrays
4.5 Using Multidimensional Arrays
4.6 Chapter Summary
4.7 Exercises
Chapter 5. Functions
5.1 Declaring and Calling Functions
5.2 Passing Arguments to Functions
5.3 Returning Values from Functions
5.4 Understanding Variable Scope
5.5 Chapter Summary
5.6 Exercises
Chapter 6. Making Web Forms
6.1 Useful Server Variables
6.2 Accessing Form Parameters
6.3 Form Processing with Functions
6.4 Validating Data
6.5 Displaying Default Values
6.6 Putting It All Together
6.7 Chapter Summary
6.8 Exercises
Chapter 7. Storing Information with Databases
7.1 Organizing Data in a Database
7.2 Connecting to a Database Program
7.3 Creating a Table
7.4 Putting Data into the Database
7.5 Inserting Form Data Safely
7.6 Generating Unique IDs
7.7 A Complete Data Insertion Form
7.8 Retrieving Data from the Database
7.9 Changing the Format of Retrieved Rows
7.10 Retrieving Form Data Safely
7.11 A Complete Data Retrieval Form
7.12 MySQL Without PEAR DB
7.13 Chapter Summary
7.14 Exercises
Chapter 8. Remembering Users with Cookies and Sessions
8.1 Working with Cookies
8.2 Activating Sessions
8.3 Storing and Retrieving Information
8.4 Configuring Sessions
Day Day Up
8.6 Why setcookie( ) and session_start( ) Want to Be at the Top of the Page
8.7 Chapter Summary
8.8 Exercises
Chapter 9. Handling Dates and Times
9.1 Displaying the Date or Time
9.2 Parsing a Date or Time
9.3 Dates and Times in Forms
9.4 Displaying a Calendar
9.5 Chapter Summary
9.6 Exercises
Chapter 10. Working with Files
10.1 Understanding File Permissions
10.2 Reading and Writing Entire Files
10.3 Reading and Writing Parts of Files
10.4 Working with CSV Files
10.5 Inspecting File Permissions
10.6 Checking for Errors
10.7 Sanitizing Externally Supplied Filenames
10.8 Chapter Summary
10.9 Exercises
Chapter 11. Parsing and Generating XML
11.1 Parsing an XML Document
11.2 Generating an XML Document
11.3 Chapter Summary
11.4 Exercises
Chapter 12. Debugging
12.1 Controlling Where Errors Appear
12.2 Fixing Parse Errors
12.3 Inspecting Program Data
12.4 Fixing Database Errors
12.5 Chapter Summary
12.6 Exercises
Chapter 13. What Else Can You Do with PHP?
13.1 Graphics
13.2 PDF
13.3 Shockwave/Flash
13.4 Browser-Specific Code
13.5 Sending and Receiving Mail
13.6 Uploading Files in Forms
13.7 The HTML_QuickForm Form-Handling Framework
13.8 Classes and Objects
13.9 Advanced XML Processing
13.10 SQLite
13.11 Running Shell Commands
13.12 Advanced Math
13.13 Encryption
13.14 Talking to Other Languages
13.15 IMAP, POP3, and NNTP
13.16 Command-Line PHP
13.17 PHP-GTK
13.18 Even More Things You Can Do with PHP
Appendix A. Installing and Configuring the PHP Interpreter
A.1 Using PHP with a Web-Hosting Provider
A.2 Installing the PHP Interpreter
A.3 Installing PEAR
A.4 Downloading and Installing PHP's Friends
A.5 Modifying PHP Configuration Directives
A.6 Appendix Summary
Appendix B. Regular Expression Basics
B.1 Characters and Metacharacters
B.2 Quantifiers
B.3 Anchors
B.4 Character Classes
B.5 Greed
B.6 PHP's PCRE Functions
B.7 Appendix Summary
B.8 Exercises
Appendix C. Answers To Exercises
C.1 Chapter 2
C.2 Chapter 3
C.3 Chapter 4
C.4 Chapter 5
C.5 Chapter 6
C.6 Chapter 7
C.7 Chapter 8
C.8 Chapter 9
C.9 Chapter 10
C.10 Chapter 11
C.11 Chapter 12
C.12 Appendix B
Colophon
Index
index_SYMBOL
index_A
index_B
index_C
index_D
index_E
index_F
index_G
index_H
index_I
index_J
index_K
index_L
index_M
index_N
index_O
index_P
index_Q
index_R
index_S
index_T
index_U
index_V
index_W
index_X
index_Z