Reputation: 537
I have been wondering about what the difference is between a normal HTML input tag and codeigniters form helper tags()?
I can understand the need for form_open, since it allows mobility in case of you changing the webaddress, but why should you use tags like form_input, form_password, form_submit etc.
Also please explain the benefits from using $this->input->post() over $_POST[]
Thanks
Upvotes: 1
Views: 471
Reputation: 23806
The advantage of using the functions of the Form helper instead of generating pure HTML is just that it's less hassle to create the form dynamically (you just pass an array instead of concatenating strings). If you want to, you can write your own HTML.
And the benefits of using $this->input->post()
is that the values have been sanitized (protected from XSS attacks), that is, but it is configurable.
Also, using $this->input->post()
won't complain if you try to get an unset parameter.
Upvotes: 6