CSC-ITC8430 - Introduction to PHP
Course Description
In this PHP training course, you will learn the basics of PHP, which is still one of the most widely used server-side languages on the web. You will start by learning how PHP works and its basic syntax. You will then learn to create dynamic interactive pages, to work with arrays, to process and validate forms, and to write functions in PHP. This will give you the groundwork you need to move on to a more advanced course that covers database-driven websites with PHP and MySQL.
Course Outline
I. 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
- Variables
- Variable Types
- Variable Names (Identifiers)
- Type Juggling and Casting
- Hello Variables!
- Variable Scope
- Superglobals
- Single Quotes vs. Double Quotes
- Concatenation
- Passing Variables on the URL
- 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
- Constants
- Error Reporting
- Displaying Errors
- Including a Secure Configuration File
- if / if - else / if - elseif - else
- Simple if Condition
- if-else Condition
- if-elseif-else statement
- False Equivalents: Falsy Values
- Testing for Variable Existence
- Exercise: Checking for Variable Existence
- switch/case
- Ternary Operator
- Null Coalescing Operator
- Arithmetic Operators
- The Modulus Operator
- Loops
- while
- do...while
- for
- break and continue
- Indexed Arrays
- Initializing Arrays
- Appending to an Array
- Reading from Arrays
- Looping through Arrays
- Associative Arrays
- Initializing Associative Arrays
- Reading from Associative Arrays
- Looping through Associative Arrays
- Superglobal 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
- 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?
Learner Outcomes
- Learn how PHP works
- Learn the basic syntax of PHP
- Create dynamic interactive pages with PHP
- Work with arrays in PHP
- Process and validate forms with PHP
- Write functions in PHP
Notes
This is an asynchronous online course offered through the third party vendor ed2go. This course can be taken on either a PC or Mac. The instructional materials required for this course are included in enrollment and will be available online. You will have three months to complete the course, and may complete the course earlier than the three month period.
Software Requirements:
PC: Windows 8 or later.
Mac: macOS 10.10 or later.
Browser: The latest version of Google Chrome or Mozilla Firefox is preferred. Microsoft Edge and Safari are also compatible.
Adobe Acrobat Reader
Software must be installed and fully operational before the course begins.
Prerequisites
- HTML
- CSS is useful