Join Jon Peck for an in-depth discussion in this video Getting user input securely, part of Learning PHP CodeIgniter (2013).
The CodeIgniter input class, which is initialized automatically, serves two purposes.…Securely pre-processing global input data, and providing helper functions for getting…input data. Among other things, it destroys global…variables if register_globals is turned on.…Filters the GET, POST and COOKIE array keys, and provides optional cross site…scripting attack filtering. Let's go back to the magazine controller.…Before I show the success message, let's save a new magazine issue.…I'll start by loading the model. This -> load -> model issue.…
Then, I'll create a new instance of the issue model.…Issue equals new issue. I'll set the publication ID, issue ->…publication id equals this, and I'm going to use the input class post method…with one argument. So input -> post, a string containing the…element I'm looking for, which is the publication id.…I'll do the same for the issue_number, equals this -> input -> post ->…issue_number, and the issue date of publication.…
Issue -> issue -> date publication equals this -> input -> post Issue_date_publication.…
Starting with the what and why of CodeIgniter, Jon introduces key concepts such as the MVC pattern and libraries by demonstrating how to create static pages, then storing and displaying magazine info in a database. Advanced topics like classes and helpers are explored to validate user input, upload files, and much more. By creating a complete system, you'll have the foundation to build your own applications with CodeIgniter.
- What is CodeIgniter?
- Creating a static page controller
- Generating output with a view
- What is a model?
- Saving data with Active Records
- Creating forms
- Validating user input
- Listing records in tables
- Uploading images
- Viewing and deleting records