You are previewing PHP for the Web: Visual QuickStart Guide, Fifth Edition.
O'Reilly logo
PHP for the Web: Visual QuickStart Guide, Fifth Edition

Book Description

Learn PHP programming the quick and easy way!
With PHP for the Web: Visual QuickStart Guide readers can start from the beginning to get a tour of the programming language, or look up specific tasks to learn just what they need to know. 
This task-based visual reference guide uses step-by-step instructions and plenty of screenshots to teach beginning and intermediate users this popular open-source scripting language. Author Larry Ullman guides readers through the ins and outs of both PHP 5 and PHP 7, and offers more efficient ways to tackle common needs.
Both beginning users, who want a thorough introduction to the technology, and more intermediate users, who are looking for a convenient reference, will find what they need here--in straightforward language and through readily accessible examples.

  • Easy visual approach uses demonstrations and real-world examples to guide you through dynamic web development using PHP and show you what to do step by step.

  • Concise steps and explanations let you get up and running in no time.

  • Essential reference guide keeps you coming back again and again.

  • Whether you’re a programming newbie or an experienced veteran learning PHP for the first time, this book will teach you all you need to know, including the latest changes in PHP and more efficient ways to tackle common needs.

  • Table of Contents

    1. Title Page
    2. Copyright Page
    3. Dedication
    4. Table of Contents
    5. Introduction
      1. What Is PHP?
      2. Why Use PHP?
      3. How PHP Works
      4. What You’ll Need
      5. About This Book
      6. Companion Website
        1. Questions, comments, or suggestions?
    6. 1. Getting Started with PHP
      1. Basic HTML Syntax
      2. Basic PHP Syntax
      3. Using SFTP
      4. Testing Your Script
      5. Sending Text to the Browser
      6. Using the PHP Manual
      7. Sending HTML to the Browser
      8. Adding Comments to Scripts
      9. Basic Debugging Steps
      10. Review and Pursue
    7. 2. Variables
      1. What Are Variables?
      2. Variable Syntax
      3. Types of Variables
        1. Numbers
        2. Strings
        3. Arrays
      4. Variable Values
      5. Understanding Quotation Marks
      6. Review and Pursue
    8. 3. HTML Forms and PHP
      1. Creating a Simple Form
      2. Choosing a Form Method
      3. Receiving Form Data in PHP
      4. Displaying Errors
      5. Error Reporting
      6. Manually Sending Data to a Page
      7. Review and Pursue
    9. 4. Using Numbers
      1. Creating the Form
      2. Performing Arithmetic
      3. Formatting Numbers
      4. Understanding Precedence
      5. Incrementing and Decrementing a Number
      6. Creating Random Numbers
      7. Review and Pursue
        1. Review
        2. Pursue
    10. 5. Using Strings
      1. Creating the HTML Form
      2. Concatenating Strings
      3. Handling Newlines
      4. HTML and PHP
      5. Encoding and Decoding Strings
      6. Finding Substrings
      7. Replacing Parts of a String
      8. Review and Pursue
        1. Review
        2. Pursue
    11. 6. Control Structures
      1. Creating the HTML Form
      2. The if Conditional
      3. Validation Functions
      4. Using else
      5. More Operators
        1. Comparison
        2. Logical
      6. Using elseif
      7. The Switch Conditional
      8. The for Loop
      9. Review and Pursue
    12. 7. Using Arrays
      1. What Is an Array?
        1. Syntactical rules for arrays
      2. Creating an Array
      3. Adding Items to an Array
      4. Accessing Array Elements
      5. Creating Multidimensional Arrays
      6. Sorting Arrays
      7. Transforming Between Strings and Arrays
      8. Creating an Array from a Form
      9. Review and Pursue
        1. Review
        2. Pursue
    13. 8. Creating Web Applications
      1. Creating Templates
      2. Using External Files
      3. Using Constants
      4. Working with the Date and Time
      5. Handling HTML Forms with PHP, Revisited
      6. Making Forms Sticky
      7. Sending Email
      8. Output Buffering
      9. Manipulating HTTP Headers
      10. Review and Pursue
        1. Review
        2. Pursue
    14. 9. Cookies and Sessions
      1. What Are Cookies?
      2. Creating Cookies
      3. Reading from Cookies
      4. Adding Parameters to a Cookie
      5. Deleting a Cookie
      6. What Are Sessions?
      7. Creating a Session
      8. Accessing Session Variables
      9. Deleting a Session
      10. Review and Pursue
        1. Review
        2. Pursue
    15. 10. Creating Functions
      1. Creating and Using Simple Functions
      2. Creating and Calling Functions That Take Arguments
      3. Setting Default Argument Values
      4. Creating and Using Functions That Return a Value
      5. Understanding Variable Scope
      6. Review and Pursue
        1. Review
        2. Pursue
    16. 11. Files and Directories
      1. File Permissions
        1. Creating the text file
        2. Setting a file’s permissions
      2. Writing to Files
      3. Locking Files
      4. Reading from Files
      5. Handling File Uploads
      6. Navigating Directories
      7. Creating Directories
      8. Reading Files Incrementally
      9. Review and Pursue
        1. Review
        2. Pursue
    17. 12. Intro to Databases
      1. Introduction to SQL
      2. Connecting to MySQL
      3. MySQL Error Handling
      4. Creating a Table
      5. Inserting Data into a Database
      6. Securing Query Data
      7. Retrieving Data from a Database
      8. Deleting Data in a Database
      9. Updating Data in a Database
      10. Review and Pursue
        1. Review
        2. Pursue
    18. 13. Putting It All Together
      1. Getting Started
      2. Connecting to the Database
      3. Writing the User-Defined Function
      4. Creating the Template
      5. Logging In
      6. Logging Out
      7. Adding Quotes
      8. Listing Quotes
      9. Editing Quotes
      10. Deleting Quotes
      11. Creating the Home Page
      12. Review and Pursue
        1. Review
        2. Pursue
    19. A. Installation and Configuration
      1. Installation on Windows
      2. Installation on Mac OS X
      3. Configuring PHP
      4. MySQL Interfaces
        1. Using the MySQL client
        2. Using phpMyAdmin
      5. Managing MySQL Users
        1. Setting the root user password
        2. Creating a database, users, and privileges
    20. B. Resources and Next Steps
      1. The PHP Manual
      2. Database Resources
      3. Top 10 Frequently Asked Questions (or Problems)
      4. Next Steps
        1. Security
        2. Object-oriented programming
        3. Frameworks
        4. JavaScript
        5. Other books
      5. Tables
    21. Index
    22. Code Snippets