Linked e-resources
Details
Table of Contents
Intro
Table of Contents
About the Authors
About the Technical Reviewer
Introduction
Part: I
Chapter 1: Getting Ready to Program
Objectives
Setting Up a Development Environment
What Is PHP? How Does PHP Work?
Apache and What It Does
Storing Info with MySQL/MariaDB
Installing PHP, Apache, and MySQL/MariaDB
Installing XAMPP
Step 1: Download XAMPP
Step 2: Follow the Instructions
Step 3: Test XAMPP to Ensure Proper Installation
Open the XAMPP Control Panel
What If Apache Isn't Running?
Verify That Apache and PHP Are Running
Choosing a PHP Editor
Creating Your First PHP Program
Running Your First PHP Script
Summary
Projects
Chapter 2: Understanding PHP: Language Basics
Objectives
Embedding PHP Scripts
Program Design and Logic
Program Design and Logic
Using echo
What Is a Variable?
Storing Values in a Variable
A Variable Is a Placeholder
Valid PHP Variable Names
Program Design and Logic
Displaying PHP Errors
Secure Programming
Creating an HTML5 Page with PHP
HTML Review
Including a Simple Page Template
Including the Template
Secure Programming
Commenting Your Code
Block and Single-Line Comments
Avoiding Naming Conflicts
The Object Operator
Using a StdClass Object for Page Data
Page Views
HTML Review
Making a Dynamic Site Navigation
HTML Review
Passing Information with PHP
Accessing URL Variables
Using isset( ) to Test If a Variable Is Set
Secure Programming
_GET, a Superglobal Array
Including Page Views Dynamically
Strict Naming Convention
Displaying a Default Page
Securing the Program
Validating Your HTML
Styling the Site with CSS
CSS Review
Declaring a Page_Data Class
Program Design and Logic
Classes Make Objects
Highlighting Current Navigation Item with a Dynamic Style Rule
Summary
Projects
Chapter 3: Form Management
Objectives
What Are Forms?
Setting Up a New PHP Project
Seeing for Yourself
Creating a Dynamic Navigation
Creating Page Views for the Form
Displaying Page Views on the Index Page
Program Design and Logic
A Simple Search Form
The Element and Some Common Types
Understanding the Method Attribute
Named PHP Functions
Program Design and Logic
The Basic Syntax for Named Functions
Program Design and Logic
Program Design and Logic
Using Function Arguments for Increased Flexibility
Creating a Form for the Quiz
HTML Review
Showing the Quiz Form
The POST Method
Secure Programming
Using the _POST Superglobal
Program Design and Logic
_POST Is an Array
Secure Programming
Curly's Law: Do One Thing
Program Design and Logic
Code Is Poetry
OOP: Using Constructors, Getters, and Setters
Secure Programming
Summary
Exercises
Chapter 4: Building a Dynamic Image Gallery
Objectives
Setting Up a Dynamic Site
Table of Contents
About the Authors
About the Technical Reviewer
Introduction
Part: I
Chapter 1: Getting Ready to Program
Objectives
Setting Up a Development Environment
What Is PHP? How Does PHP Work?
Apache and What It Does
Storing Info with MySQL/MariaDB
Installing PHP, Apache, and MySQL/MariaDB
Installing XAMPP
Step 1: Download XAMPP
Step 2: Follow the Instructions
Step 3: Test XAMPP to Ensure Proper Installation
Open the XAMPP Control Panel
What If Apache Isn't Running?
Verify That Apache and PHP Are Running
Choosing a PHP Editor
Creating Your First PHP Program
Running Your First PHP Script
Summary
Projects
Chapter 2: Understanding PHP: Language Basics
Objectives
Embedding PHP Scripts
Program Design and Logic
Program Design and Logic
Using echo
What Is a Variable?
Storing Values in a Variable
A Variable Is a Placeholder
Valid PHP Variable Names
Program Design and Logic
Displaying PHP Errors
Secure Programming
Creating an HTML5 Page with PHP
HTML Review
Including a Simple Page Template
Including the Template
Secure Programming
Commenting Your Code
Block and Single-Line Comments
Avoiding Naming Conflicts
The Object Operator
Using a StdClass Object for Page Data
Page Views
HTML Review
Making a Dynamic Site Navigation
HTML Review
Passing Information with PHP
Accessing URL Variables
Using isset( ) to Test If a Variable Is Set
Secure Programming
_GET, a Superglobal Array
Including Page Views Dynamically
Strict Naming Convention
Displaying a Default Page
Securing the Program
Validating Your HTML
Styling the Site with CSS
CSS Review
Declaring a Page_Data Class
Program Design and Logic
Classes Make Objects
Highlighting Current Navigation Item with a Dynamic Style Rule
Summary
Projects
Chapter 3: Form Management
Objectives
What Are Forms?
Setting Up a New PHP Project
Seeing for Yourself
Creating a Dynamic Navigation
Creating Page Views for the Form
Displaying Page Views on the Index Page
Program Design and Logic
A Simple Search Form
The Element and Some Common Types
Understanding the Method Attribute
Named PHP Functions
Program Design and Logic
The Basic Syntax for Named Functions
Program Design and Logic
Program Design and Logic
Using Function Arguments for Increased Flexibility
Creating a Form for the Quiz
HTML Review
Showing the Quiz Form
The POST Method
Secure Programming
Using the _POST Superglobal
Program Design and Logic
_POST Is an Array
Secure Programming
Curly's Law: Do One Thing
Program Design and Logic
Code Is Poetry
OOP: Using Constructors, Getters, and Setters
Secure Programming
Summary
Exercises
Chapter 4: Building a Dynamic Image Gallery
Objectives
Setting Up a Dynamic Site