Course duration
- 5 days
Course Benefits
- Learn how PHP works.
- Learn the basic syntax of PHP.
- Learn to create dynamic interactive pages with PHP.
- Learn to manipulate files with PHP.
- Learn to work with arrays in PHP.
- Learn to validate forms with PHP.
- Learn to write functions in PHP.
- Learn to manipulate and manage database data with PHP.
- Learn to authenticate users with PHP.
- Learn to manage sessions with PHP.
- Learn to work with the MDB2 package.
- Learn advanced form validation with regular expressions.
- Learn to send email with PHP.
- Understand how MySQL works.
- Learn to use SQL to output reports with MySQL.
- Learn to modify MySQL data with SQL.
Public expert-led online training from the convenience of your home, office or anywhere with an internet connection. Guaranteed to run .
Private classes are delivered for groups at your offices or a location of your choice.
Course Outline
- PHP Basics
- Welcome to the Server-side
- What is a web server?
- Dynamic Websites
- Google Chrome DevTools: Network Tab
- Status Codes
- How PHP Works
- The php.ini File
- PHP Tags
- Hello, World!
- Comments
- PHP Statements and Whitespace
- PHP Functions
- php.net
- Exercise: Using php.net
- Variables
- Variable Types
- Variable Names (Identifiers)
- Type Juggling and Casting
- Hello Variables!
- Exercise: First PHP Script
- Variable Scope
- Superglobals
- Single Quotes vs. Double Quotes
- Concatenation
- Passing Variables on the URL
- Exercise: Passing Variables via the Query String
- User-defined Functions (UDFs)
- Defining and Calling Functions
- Default Values
- Variable Scope
- By Reference vs. By Value
- Introduction to the Poet Tree Club
- Including Files
- require
- require_once
- Exercise: Using Header and Footer Includes
- Constants
- Error Reporting
- Exercise: Displaying Errors
- Including a Secure Configuration File
- Exercise: Including a Configuration File
- Welcome to the Server-side
- Flow Control
- if / if-else / if-elseif-else
- Simple if Condition
- if-else Condition
- if-elseif-else statement
- False Equivalents: Falsy Values
- switch/case
- Ternary Operator
- Exercise: Working with Conditions
- Loops
- while
- dowhile
- for
- break and continue
- Exercise: Working with Loops
- if / if-else / if-elseif-else
- Arrays
- Indexed Arrays
- Initializing Arrays
- Appending to an Array
- Reading from Arrays
- Looping through Arrays
- Exercise: Working with Indexed Arrays
- Associative Arrays
- Initializing Associative Arrays
- Reading from Associative Arrays
- Looping through Associative Arrays
- Superglobal Arrays
- Exercise: Working with Associative Arrays
- Multi-dimensional Arrays
- Reading from Two-dimensional Arrays
- Looping through Two-dimensional Arrays
- Two-dimensional Associative Arrays
- Non-tabular Multi-dimensional Arrays
- Array Manipulation Functions
- in_array() Function
- Exercise: Array Practice
- Indexed Arrays
- PHP and HTML Forms
- HTML Forms
- How HTML Forms Work
- Form Submissions
- Sanitizing Form Data
- htmlspecialchars()
- htmlentities()
- filter_var()
- filter_input()
- Validating Form Data
- Was the Field Filled In?
- Is the Entered Value an Integer?
- Is it an Email?
- Is it a Valid Password and Do the Passwords Match?
- Do the Combined Values Create a Valid Date?
- Did the User Check the Box?
- Exercise: Processing Form Input
- HTML Forms
- String Manipulation
- Formatting Strings
- Concatenation
- String Manipulation Functions
- Examples of String Functions
- Exercise: Working with String Manipulation Functions
- Formatting Strings
- Reusing Code and Writing Functions
- Including Files
- require
- require_once
- Exercise: Adding a Header and Footer
- auto_prepend_file and auto_append_file
- User Functions
- Defining and Calling Functions
- Default Values
- Variable Scope
- By Reference vs. By Value
- Form Processing
- Code Organization
- Exercise: Form Validation and Presentation Functions
- Including Files
- Simple SELECTs
- Introduction to the Northwind Database
- Some Basics
- Comments
- Whitespace and Semi-colons
- Case Sensitivity
- SELECTing All Columns in All Rows
- Exercise: Exploring the Tables
- SELECTing Specific Columns
- Exercise: SELECTing Specific Columns
- Sorting Records
- Sorting by a Single Column
- Sorting By Multiple Columns
- Ascending and Descending Sorts
- Exercise: Sorting Results
- The WHERE Clause and Logical Operator Symbols
- Checking for Equality
- Checking for Inequality
- Exercise: Using the WHERE Clause to Check for Equality or Inequality..252
- Checking for Greater or Less Than
- Exercise: Using the WHERE Clause to Check for Greater or Less Than.256
- Checking for NULL
- Exercise: Checking for NULL
- WHERE and ORDER BY
- Exercise: Using WHERE and ORDER BY Together
- Checking Multiple Conditions with Boolean Operators
- AND
- OR
- Order of Evaluation
- Exercise: Writing SELECTs with Multiple Conditions
- The WHERE Clause and Logical Operator Keywords
- The BETWEEN Operator
- The IN Operator
- The LIKE Operator
- The NOT Operator
- Exercise: More SELECTs with WHERE
- Advanced SELECTs
- Calculated Fields
- Concatenation
- Mathematical Calculations
- Aliases
- Exercise: Calculating Fields
- Aggregate Functions and Grouping
- Aggregate Functions
- Grouping Data
- Exercise: Working with Aggregate Functions
- Selecting Distinct Records
- Built-in Data Manipulation Functions
- Common Math Functions
- Common String Functions
- Common Date Functions
- Exercise: Data Manipulation Functions
- Calculated Fields
- Subqueries, Joins and Unions
- Subqueries
- Exercise: Subqueries
- Joins
- Table Aliases
- Multi-table Joins
- Exercise: Using Joins
- Outer Joins
- Unions
- UNION ALL
- UNION Rules
- Exercise: Working with Unions
- Inserting, Updating and Deleting Records
- INSERT
- Exercise: Inserting Records
- UPDATE
- DELETE
- Exercise: Updating and Deleting Records
- Managing Data
- Querying a Database
- mysqli() Overview
- mysqli Methods and Properties
- Inserting and Updating Records
- Exercise: Inserting Records
- mysqli Prepared Statements
- Querying a Database
- MDB2
- Advantages and Disadvantages of MDB2
- Why use a database abstraction layer?
- When not to use a database abstraction layer?
- Using MDB2
- Exercise: Creating a Customer Report
- Advantages and Disadvantages of MDB2
- Authentication with PHP and SQL
- The Registration Process
- Passwords and Pass Phrases
- Registration with Tokens
- Exercise: Creating a Registration Form
- Sessions
- Session Variables
- Cookies
- Exercise: Logging in
- Logging Out
- $_REQUEST Variables
- Exercise: Resetting the Pass Phrase
- Regular Expressions
- Perl-compatible Regular Expression Functions
- preg_match()
- preg_replace()
- Regular Expression Tester
- Regular Expression Syntax
- Start and End ( ^ $ )
- Number of Occurrences ( ? + * {} )
- Common Characters ( . \d \D \w \W \s \S )
- Grouping ( [] )
- Negation ( ^ )
- Subpatterns ( () )
- Alternatives ( | )
- Escape Character ( \ )
- Form Validation Functions with Regular Expressions
- Perl-compatible Regular Expression Functions
- Session Control and Cookies
- Sessions
- Configuring Sessions
- Session Functions
- Cookies
- Exercise: Authentication with Session Control
- Sessions
- Sending Email with PHP
- mail()
- Shortcomings of mail()
- Setting Up PHPMailer
- Get and Install the Latest Version of PHPMailer
- Mail Server
- Exercise: Including a Mail Configuration File
- Sending Email with PHPMailer
- PHPMailer Methods and Properties
- Exercise: Creating a Contact Form
- mail()
- File System Management
- Opening a File
- fopen()
- Reading from a File
- fgets()
- Writing to a File
- fwrite()
- Exercise: Writing to a File
- File Locking
- flock()
- Uploading Files via an HTML Form
- Getting File Information
- More File Functions
- Directory Functions
- Getting a Directory Listing
- Exercise: Creating a Resume Management Page
- Opening a File
Each student will receive a comprehensive set of materials, including course notes and all the class examples.
Experience in the following is required for this PHP class:
- HTML
Experience in the following would be useful for this PHP class:
- CSS
- Basic Programming
- XML
Instructor-led courses are offered via a live Web connection, at client sites throughout Europe, and at our Geneva Training Center.