- Introduction
- What is PHP?
- Why Use PHP?
- How PHP Works
- What You’ll Need
- About This Book
- Companion Web Site
- Chapter 1: Getting Started With PHP
- Basic XHTML Syntax
- Basic PHP Syntax
- Testing Your Script
- Sending Text to the Browser
- Sending HTML to the Browser
- Using White Space
- Adding Comments to Scripts
- Basic Debugging Steps
- Chapter 2: Variables
- What are Variables?
- Variable Syntax
- Types of Variables
- Assigning Values to Variables
- Understanding Quotation Marks
- Chapter 3: HTML Forms and PHP
- Creating a Simple Form
- Using GET or POST
- Receiving Form Data in PHP
- Displaying Errors
- Error Reporting
- Manually Sending Data to a Page
- Chapter 4: Using Numbers
- Creating the Form
- Performing Arithmetic
- Formatting Numbers
- Understanding Precedence
- Incrementing and Decrementing a Number
- Creating Random Numbers
- Chapter 5: Using Strings
- Creating the HTML Form
- Connecting Strings (Concatenation)
- Handling Newlines
- HTML and PHP
- Encoding and Decoding Strings
- Finding Substrings
- Replacing Parts of a String
- Chapter 6: Control Structures
- Creating the HTML Form
- The if Conditional
- Validation Functions
- Using Else
- More Operators
- Using elseif
- The Switch Conditional
- The For Loop
- Chapter 7: Using Arrays
- What Is an Array?
- Creating an Array
- Adding Items to an Array
- Accessing Array Elements
- Creating Multidimensional Arrays
- Sorting Arrays
- Transforming Between Strings and Arrays
- Creating an Array from a Form
- Chapter 8: Creating Web Applications
- Creating Templates
- Using External Files
- Using Constants
- Working with the Date and Time
- Handling HTML Forms with PHP, Revisited
- Making Forms Sticky
- Sending Email
- Output Buffering
- Manipulating HTTP Headers
- Chapter 9: Cookies and Sessions
- What Are Cookies?
- Creating Cookies
- Reading from Cookies
- Adding Parameters to a Cookie
- Deleting a Cookie
- What Are Sessions?
- Creating a Session
- Accessing Session Variables
- Deleting a Session
- Chapter 10: Creating Functions
- Creating and Using Simple Functions
- Creating and Calling Functions that Take Arguments
- Setting Default Argument Values
- Creating and Using Functions that Return a Value
- Understanding Variable Scope
- Chapter 11: Files and Directories
- File Permissions
- Writing to Files
- Locking Files
- Reading from Files
- Handling File Uploads
- Navigating Directories
- Creating Directories
- Reading Files Incrementally
- Chapter 12: Intro to Databases
- Introduction to SQL
- Connecting to MySQL
- MySQL Error Handling
- Creating and Selecting a Database
- Creating a Table
- Inserting Data into a Database
- Securing Query Data
- Retrieving Data from a Database
- Deleting Data in a Database
- Updating Data in a Database
- Chapter 13: Regular Expressions
- What are Regular Expressions?
- Matching Patterns
- Using Literals
- Using Metacharacters
- Using Quantifiers
- Using Classes
- Matching and Replacing Patterns
- Appendix A: Installation and Configuration
- Installing on Windows
- Installing on Mac OS X
- Using the MySQL Client
- Creating MySQL Users
- PHP Configuration
- Appendix B: Resources and Next Steps
- Online PHP Resources
- Database Resources
- Top Ten Frequently Asked Questions (or Problems)
- Next Steps
- Tables