INTRODUCTION
- What is PHP?
- A Brief History of PHP
- Yes, But What Does PHP Do?
- Is PHP Right for Me?
- For More Stuff
PART I: GETTING STARTED
Chapter 1: Installing and Configuring MySQL
- If You're Using Windows
- Installing MySQL for Windows
- Testing Your MySQL Installation
- Starting MySQL
- Creating a Test Database
- Creating a Test Table
- Selecting Data from Your Test Table
- If You're Using Linux
- Installing MySQL for Linux
- Testing Your MySQL Installation
- Starting MySQL
- Creating a Test Database
- Creating a Test Table
- Selecting Data from Your Test Table
Chapter 2: Installing Apache
- If You're Using Windows
- Installing Apache for Windows
- Configuring Apache
- Starting Apache
- Starting Apache as a Service
- Manually Starting and Stopping Apache
- Connecting to Apache
- If You're Using Linux
- Installing Apache for Linux
- Configuring Apache
- Starting and Stopping Apache
- Connecting to Apache
Chapter 3: Installing PHP4
- If You're Using Windows
- Installing PHP4 for Windows
- Configuring Apache to Use PHP4
- Restarting Apache and Testing the PHP4 Installation
- If You're Using Linux
- Installing PHP4 for Linux
- Configuring Apache to Use PHP4
- Restarting Apache and Testing the PHP4 Installation
PART II: THE ABSOLUTE BASICS OF CODING IN PHP
Chapter 4: Mixing PHP and HTML
- How PHP is Parsed
- PHP Start and End Tags
- Code Cohabitation
- The Importance of the Instruction Terminator
- Escaping Your Code
- Commenting Your Code
Chapter 5: Introducing Variables and Operators
- What's a Variable?
- Naming Your Variables
- PHP Variable and Value Types
- What's an Operator?
- PHP Operator Types
- Assignment Operators
- Arithmetic Operators
- Comparison Operators
- Logical Operators
Chapter 6: Using PHP Variables
- Getting Variables from Forms
- Creating a Calculation Form
- Creating the Calculation Script
- Submitting Your Form and Getting Results
- HTTP Environment Variables
- Retrieving and Using REMOTE_ADDR
- Retrieving and Using HTTP_USER_AGENT
PART III: START WITH THE SIMPLE STUFF
Chapter 7: Displaying Dynamic Content
- Displaying Browser-Specific HTML
- Displaying Platform-Specific HTML
- Working with String Functions
- Creating an Input Form
- Creating a Script to Display Form Values
- Submitting Your Form and Getting Results
- Redirecting to a New Location
- Creating a Redirection Form
- Creating the Redirection Script and Test It
Chapter 8: Sending E-Mail
- Windows Users: Check Your php.ini File
- The Simple Feedback Form
- Creating the Feedback Form
- Creating a Script to Mail Your Form
- Submitting Your Form and Getting Results
- A Feedback Form with Custom Error Messages
- Creating the Initial Script
- Adding Error Checking to the Script
- Submitting Your Form and Getting Results
- Saving the Values if You Make an Error
Chapter 9: Using Your Filesystem
- A Note Regarding File Paths
- Displaying Directory Contents
- Working with fopen() and fclose()
- Creating a New File
- Checking if the File Exists
- Creating a New File
- Appending Data to an Existing File
- Reading Data From a File
- Sending File Contents Via E-Mail
- File System Housekeeping
- Copying Files
- Renaming Files
- Deleting Files
Chapter 10: Uploading Files to Your Web Site
- Check Your php.ini File
- Understanding the Process
- Creating the Form
- Creating the Upload Script
- Uploading a File Using Your Form and Script
PART IV: GETTING TO KNOW YOUR DATABASE
Chapter 11: Establishing a Connection and Poking Around
- Creating a Username and Password
- Connecting to MySQL
- Break Your Connection Script
- Listing Databases on a Server
- Listing Tables in a Database
- Creating a New Database
- Deleting a Database
Chapter 12: Creating a Database Table
- Planning Your Fields
- A Word About Datatypes
- The Importance of Unique Fields
- A Word About Datatypes
- A Two-Step Form Sequence
- Step 1: Number of Fields
- Step 2: Define Your Fields
- Start the Process
- Creating the Table Creation Script
- Create that Table!
Chapter 13: Inserting Data into the Table
- Creating the Record Addition Form
- Creating the Record Addition Script
- Populating Your Table
Chapter 14: Selecting and Displaying Data
- Planning and Creating Your Administrative Menu
- Selecting Data From the my_music Table
- Displaying Records Ordered by ID
- Displaying Records Ordered by Date Acquired
- Displaying Records Ordered by Title
- Displaying Records Ordered by Artist
PART V: USER AUTHENTICATION AND TRACKING
Chapter 15: Database-Driven User Authentication
- Why Authenticate Anyone?
- Creating the User Table
- Adding Users to Your Table
- Creating the User Addition Form and Script
- Adding Some Users
- Creating the Login Form
- Creating the Authentication Script
- Try to Authenticate Yourself
Chapter 16: Using Cookies
- What's a Cookie?
- Setting Cookies
- Counting Time
- Setting a Test Cookie
- Using Cookie Variables
- Using Cookies with Authentication
- Checking for the Authentication Cookie
Chapter 17: Session Basics
- Checking Your php.ini File
- What's a Session?
- Understanding Session Variables
- Starting a Session
- Registering and Modifying Session Variables
- Managing User Preferences with Sessions
- Registering Defaults
- Making Preference Changes
- Displaying Changes
PART VI: CREATING YOUR OWN CONTACT MANAGEMENT SYSTEM
Chapter 18: Planning Your System
- Plan and Create the Administration Menu
- Login to the Administration Menu
- Defining the my_contacts Table
- Modifying the Table Creation Scripts
- Creating the my_contacts Table
Chapter 19: Adding Contacts
- Creating the Record Addition Form
- Creating the Record Addition Script
- Populating Your Table
Chapter 20: Modifying Contacts
- Creating the Record Selection Form
- Creating the Record Modification Form
- Creating the Record Modification Script
- Modifying Records
Chapter 21: Deleting Contacts
- Using the Record Selection Form
- Creating the Record Deletion Form
- Creating the Record Deletion Script
- Deleting Records
Chapter 22: Working with Contacts
- Modifying Your Administration Menu
- Show Number of Contacts
- Display Today's Date
- Show Birthdays in Current Month
- Select Data From the my_contacts Table
- Display Record List
- Display Read-Only Record
PART VII: APPENDICES
Appendix A: Additional Configuration Options
- Windows Extensions
- Linux Configuration Options
Appendix B: Essential PHP Function Reference
- PHP Start and End Tags
- Variables
- Operators
- Control Structures
- Built-In Functions
Appendix C: Basic MySQL Reference
- CREATE or DROP a Database
- CREATE or DROP a TABLE
- ALTER a Table
- INSERT, UPDATE or REPLACE Within a Table
- DELETE From a Table
- SELECT From a Table
- A Few String Functions
- A Few Date and Time Functions
Appendix D: Getting Help
- PHP Resources
- Web Sites
- Mailing Lists
- User Groups
- MySQL Resources
- Apache Resources
Appendix E: What's on the CD-ROM
