• A learn-by-doing approach with complete coding examples
• Packed with over 70 new PHP 8 functions
• Classroom-tested both with online and lecture classes
Write solid, secure, object-oriented code in the new PHP 8. In this book you will create a complete three-tier application using a natural process of building and testing modules within each tier. This practical approach teaches you about app development and introduces PHP features when they are actually needed rather than providing you with abstract theory and contrived examples.
In Learn PHP 8, programming examples take advantage of the newest PHP features; you’ll follow a learn-by-doing approach, which provides you with complete coding examples. “Do It” exercises in each chapter provide the opportunity to make adjustments to the example code. The end-of-chapter programming exercises allow you to develop your own applications using the algorithms demonstrated in the chapter.
Each tier is logically and physically separated using object-oriented and dependency injection techniques, thus allowing independent tiers that can be updated with little or no effect on the other tiers. In addition to teaching good programming practices through OOP, there is a strong emphasis on creating secure code.
As each chapter is completed, you’ll have the opportunity to design and create an application reinforcing the concepts learned.
What You Will Learn
• Program PHP 8 web applications
• Use interfaces, containers, and platforms
• Apply modular programming
• Manage data objects and use MySQL and other databases
• Work with multi-functional and secure user interfaces
• Handle logging exceptions and more
Author(s): Steve Prettyman
Edition: Second Edition
Publisher: Apress
Year: 2020
Language: English
Commentary: True PDF
Pages: 426
Table of Contents
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
Chapter 1: An Introduction to PHP 8
Chapter Objectives/Student Learning Outcomes
PHP 7, PHP 7.4+, PHP 8, and PHP.NET
PHP Versions: PHP 7+, PHP 7.4+, and PHP 8+
Do It
PHP, JavaScript, CSS, HTML, and Apache Web Server
Do It
PHP, Apache, and MySQL/MariaDB
Do It
Putting It All Together—PHP, Apache, and MySQL
easyPHP
Common Installation Problems
Missing C# Library
Port Conflicts
Missing Files
Cannot Install Files in Program Files Directory
Apache Delays and Hang-Ups
Other Errors
Configurations
XAMPP
Common Installation Problems
Port Conflicts
Missing Files
Cannot Install Files in Program Files Directory
Apache Delays and Hang-Ups
Other Errors
Configurations
Microsoft Internet Information Server
Do It
Testing Your Environment
Testing Your Administration Environment
Do It
Testing Your PHP Environment
Common Problems
Do It
Alias (Working) Directories
Do It
Notepad++, Editors, and Code Testers
Notepad++
Other Editors
Do It
Chapter Terms
Chapter Questions and Projects
Chapter 2: Interfaces, Platforms, and Three-Tier Programming
Chapter Objectives/Student Learning Outcomes
PHP Platforms
PHP, AJAX, and CSS—Web Applications
Do It
PHP, AJAX, and CSS—Smart Phone Web Applications
Do It
PHP, HTML, JavaScript, CSS, and Dynamic Web Pages
Do It
PHP Three-Tier Architecture
Do It
Interface Tier
Do It
Business Rules Tier
Do It
Data Tier
Do It
Putting It All Together
Case Study
Interface Tier
Business Rules Tier
Data Tier
Do It
MVC and Dependency Injection
Chapter Terms
Chapter Questions and Projects
Chapter 3: The Basics: PHP 8 Syntax
Chapter Objectives/Student Learning Outcomes
The Basic Syntax
Do It
Conditional Statements
Do It
Functions
Do It
Arrays
Do It
Chapter Terms
Chapter Questions and Projects
Chapter 4: Modular Programming
Chapter Objectives/Student Learning Outcomes
PHP Libraries, Extensions, Classes, and Objects
PHP Extensions
Classes and Objects
Creating a PHP Class
Do It
Return Method
Do It
Set Methods
Do It
Get Methods
Do It
Constructor Method
Do It
Chapter Terms
Chapter Questions and Projects
Chapter 5: Secured User Interfaces
Chapter Objectives/Student Learning Outcomes
Secured User Interaction
HTML5 Form Validation
Do It
PHP Filtering
Do It
Additional HTML Input Security
HTML5 Select List Box and Radio Buttons
Do It
Validating Input with an XML File
Do It
Dependency Injection
Do It
Chapter Terms
Chapter Questions and Projects
Chapter 6: Handling and Logging Exceptions
Chapter Objectives/Student Learning Outcomes
Handling Exceptions
Do It
Exception and Error Handling vs. If/Else Conditions
Do It
Logging Exceptions
Do It
Reading Log and Text Files
Do It
Chapter Terms
Chapter Questions and Projects
Chapter 7: Data Objects
Chapter Objectives/Student Learning Outcomes
The Data Class
JSON Data
MySQL and NoSQL Data with MySQL 8+
Do It
Backup and Recovery
JSON Backup and Recovery
MySQL Backup and Recovery
Do It
Connecting the Data Tier
Do It
Chapter Terms
Chapter Questions and Projects
Chapter 8: Authentication
Chapter Objectives/Student Learning Outcomes
Verification and Sessions
JSON Data
MySQL Data
Do It
Registration
JSON Data
MySQL Data
Logging In
JSON Data
MySQL Data
Change Password
JSON Data
MySQL Data
Do It
Chapter Terms
Chapter Questions and Projects
Chapter 9: Multifunctional Interfaces
Chapter Objectives/Student Learning Outcomes
The Complete Application
Data Handling Using JavaScript
Do It
Updating, Deleting, and Inserting in the Interface Tier
Do It
Updating, Deleting, and Inserting in the Business Rules Tier
Do It
Final Touches
Do It
ABC Canine Shelter Reservation System Logical Design
Limitations/Suggestions
Chapter Terms
Chapter Questions and Projects
Index