Week 3. HTML Forms
Chapter 9

Introducing PHP Forms

1. What Are Forms?

2. Why Use Forms in PHP?

3. PHP and Form Processing

4. Best Practices for PHP Forms

Note: Properly designed forms enhance user experience and ensure secure interactions with your web application.


Assignments


Demos

The above shows how to set up a form to gather information from a user via GET and POST super globals.

The "Simple Sticky Form" demonstrates how to pass the values a user provides to re-populate the form. Note: This example passes the values via the POST super global. It works for the GET super global in same fashion.

The "All in One Form" shows many of the HTML controls that you may use to get a user's input to a set of values. For example, instead of asking for a "true" or "false" from a user, you can have them click a checkbox. Also, instead of asking a use to pick "one of something", you can ask via a set of radio buttons. These controls show you how to gather users input.

The Simple Dropdown Form shows how to use one of the controls shown in the "All in One Form", namely the Dropdown menu.

The Forms - "Form - NOT Secure" and "Form - Secure" are examples that show how JavaScript code can be blocked. You do not want a bad actor to use your form to launch a JavaScript routine (like a mass emailing of spam).

The "Redirect Form" shows how a simple radio button can redirect a Browser to another Website or code.