HTML and CSS Reference
Figure 8-4. The database tables viewed in phpMyAdmin
Handling Form Submissions
One of the major components of any app is the manner in which it accepts form submissions. In order to maximize
the efficiency of your app, it's worth taking some time to plan how all form submissions should be structured,
sanitized, processed, and stored.
Planning the Form Submission Workflow
First, we need to establish the form submission workflow:
The user submits a form to the appropriate controller, which is determined by the form's
The controller recognizes a form submission and checks for a valid action.
If a valid action is found, the submission is checked for legitimacy using a nonce.
Valid submissions are sent to the method specified by the action.
The handler method processes data, hands it to the model for storage, and returns a
Boolean flag to indicate success or failure.
The user is redirected to the proper page (or, in many cases, the page simply updates with
the new data).
Given this workflow, you can now start to flesh out the different steps of the form submission process.