-
This course will show you how to work with PHP Superglobals such as $_GET and $_POST while using a security-conscious mindset. External inputs, like HTML forms, are considered a security vulnerability so you should always filter inputs and escape outputs. Using PHP Superglobals when using external inputs such as HTML forms, cookies, sessions, and web servers will give you a security-conscious mindset that you can apply to all of your projects.
What you'll learn
- Build a simple HTML form
- Use PHP Superglobals when accessing external data
- echo variables using query strings with $_GET
- echo variables using without query strings with$_POST
- Filter inputs with filter_input() for various input types
- Escape outputs with htmlentities(), htmlspecialchars(), and strip_tags()
- Develop a security-conscious mindset for all of your projects
Overview
Syllabus
-
$_GET and $_POST
Superglobals can be used globally without typing global $variable; which means they are available inside of functions or methods by default.
Chevron 6 steps- instruction
Introducing Superglobals $_GET and $_POST
- instruction
Working with $_GET Values
- instruction
Using $_GET variables in a Function
- instruction
Working with $_POST Values
- instruction
Choosing Between $_GET and $_POST
-
Quiz 1
5 questions
Filtering Inputs and Escaping Outputs
Inputs from contact forms and any external inputs in general should be considered a security vulnerability and should not be trusted to be what you might expect.
Chevron 3 steps- instruction
Always Filter Inputs
- instruction
Always Escape Outputs
-
Quiz 2
5 questions
- instruction