PHP 5 Fast & Easy Web Development

cover of PHP 5 Fast & Easy Web DevelopmentThis book is at least 6 years out of date. I do not recommend you purchase it! Also, please note there is a book called PHP 6 Fast & Easy Web Development that includes my name on the cover. I did not participate in the creation of the book and was against the title, since PHP 6 did not exist at the time the book was published (2008) and doesn’t yet/probably won’t exist.

This book is technically a third edition of PHP Fast & Easy, with extra chapters and updated code based on PHP 5. This book is written in a step-by-step, visual fashion and is geared toward beginners using PHP and MySQL. The reader is shown methods for installation, then moves into creating simple scripts, followed by database applications. Although this book has PHP 5 in its title, many of the special features of PHP 5 involve elements which are outside the scope of this book (i.e. OOP). If you are looking for an book that specifically deals with PHP 5 in depth, this isn’t it!

  • ISBN 1592004733, © Thompson/Course.com 2004
  • Download the source code.

Table of Contents

» INTRODUCTION

  • What is PHP?
  • A Brief History of PHP
  • What Does PHP Do?
  • Why PHP 5?
    • Overview of Changes in PHP5
    • Backwards Compatibility with PHP 4
  • Is PHP Right for You?
  • Who Should Read this Book
  • How this Book is Organized
  • Conventions in this Book
  • More Stuff

» PART I: GETTING STARTED

Chapter 1: Installing and Configuring MySQL

  • Various MySQL Distributions
  • Installing MySQL on Windows
    • Testing Your MySQL Installation
  • Installing MySQL for Linux
    • Testing Your MySQL Installation

Chapter 2: Installing Apache

  • Installing Apache for Windows
    • Configuring Apache on Windows
    • Starting and Connecting to Apache
  • Installing Apache for Linux/UNIX
    • Configuring Apache on Linux/UNIX
    • Starting and Connecting to Apache

Chapter 3: Installing PHP

  • Installing PHP for Windows
    • Configuring Apache to Use PHP
    • Testing the PHP Installation
  • If You’re Using Linux
    • Configuring Apache to Use PHP
    • Testing the PHP 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?
    • Assignment Operators
    • Arithmetic Operators
    • Comparison Operators
    • Logical Operators

Chapter 6: Using 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 Testing It

Chapter 8: Sending E-Mail

  • Using an SMTP Server
    • SMTP­Related Changes in php.ini
  • 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 File System

  • File Paths and Permissions
  • Displaying Directory Contents
  • Working with fopen() and fclose()
    • Creating a New File
    • Appending Data to a 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 MYSQL DATABASE

Chapter 11: Establishing a Connection

  • Working with User Privileges in MySQL
    • Creating a New User
  • Connecting to MySQL
    • Breaking 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 for Your Tables
    • Basic MySQL Data Types
    • Defining Your Fields
    • The Importance of Unique Fields
  • A Two-Step Form Sequence
    • Step 1: Number of Fields
    • Step 2: Define Your Fields
    • Starting the Table Creation 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
  • Trying 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

Chapter 17: Session Basics

  • Before You Begin…Checking php.ini
  • What’s a Session?
  • Understanding Session Variables
    • Starting a Session
    • Registering and Modifying Session Variables
  • Managing User Preferences with Sessions
    • Starting a Session and Registering Defaults
    • Making Preference Changes
    • Displaying Changes

» PART VI: CREATING YOUR OWN CONTACT MANAGEMENT SYSTEM

Chapter 18: Planning Your System

  • Planning and Creating the Administration Menu
    • Logging In 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 Contacts

Chapter 21: Deleting Contacts

  • Using the Record-Selection Form
  • Creating the Record-Deletion Form
  • Creating the Record-Deletion Script
  • Deleting Contacts

Chapter 22: Working with Contacts

  • Modifying Your Administration Menu
    • Showing the Number of Contacts
    • Displaying Today’s Date
    • Showing the Birthdays in the Current Month
  • Selecting Data from the my_contacts Table
    • Displaying Record List
    • Displaying Read-Only Record

» PART VII: ADDITIONAL PROJECT EXAMPLES

Chapter 23: Managing a Simple Mailing List

  • A Brief Word About Mailing List Software
  • Developing a Subscription Mechanism
    • Creating the subscribers Table
    • Creating the Subscription Form
    • Testing the Subscription Form
  • Developing the Mailing Mechanism
    • Creating the Newsletter Form
    • Creating the Script to Mail Your Newsletter
    • Testing Your Mailing List Mechanism

Chapter 24: Creating Custom Logs and Reports

  • A Note About Apache Log Files
  • Simple Access Counting with MySQL
    • Creating the Database Table
    • Creating the Code Snippet
    • Displaying the Count
    • Creating Your Personal Access Report

Chapter 25: Working with XML

  • What is XML?
    • Basic XML Document Structure
    • Preparing to use XML with PHP
  • Parsing XML with PHP
    • Parse and Display Content from XML Files

» PART VIII: APPENDICES

Appendix A: Additional Configuration Options

Appendix B: Basic PHP Language Reference

Appendix C: Writing Your Own Functions and Objects

Appendix D: Database Normalization and MySQL Reference

Appendix E: Using SQLite

Appendix F: Getting Help

Comments are closed.