Let's move on to see how you use your HTML pages. One of the most important parts of any dynamic site is interaction with the users, and this usually means HTML forms.
The CI form helper is a very useful piece of code. It introduces a slightly different syntax, which makes form creation easier. Let's build a form that allows you to enter data on your site about a new website. In the sites
table, we want to enter the name, type, and URL of the website, and the date when it was updated.
You can build the form as a simple HTML file, or you can build it inside a controller, then pack it into a variable, call a view, and pass the variable to the view. We will do it the second way. You can also write it entirely in the view if you want.
First, you have to load the form helper into the controller where you need to use it. Then, you put the following line in the controller's constructor function:
$this->load->helper('form');
Now, you have to start the form.
Now...