Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
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. Tell the issue to save itself. Let's make this success message a tiny bit more verbose by passing the issue to the view. So, comma array, set a key called issue, and assign it to the issue itself. Save the controller, then open the magazine form success view.
I'm going to echo the HTML escaped issue, Issue ID. So, magazine number PHP echo html_ escape issue -> issue_id. Close it out, put in a space, and then save the view. Let's go back to the browser and refresh. It'll ask me if I wish to confirm the re-submission of the form. Say yes. Now, I see a message saying that magazine number two has been created.
However, if I navigate back to the root page, I don't see a list containing the magazines I created, I only see the one that is being loaded by ID. Let's fix that.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 101058 Viewers
61 Video lessons · 87839 Viewers
71 Video lessons · 71720 Viewers
56 Video lessons · 103597 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.