to be sure |
[eluser]bas_vdl[/eluser]
i know you can write CI applications in a lot of different ways. i just want some feed-back on my code? it's early in the project so it is easy to change the way of coding. Controller - add: Code: function insert_record($data) Model - add: Code: function add()
[eluser]n0xie[/eluser]
I believe you have your model and controller mixed up Apart from the lack of form_validation rules, it seems fine by me (well obviously you would also want to do some data validation and sanitizing). One thing I would do is load the error and confirm message from a language file, if there is even the slightest chance the site/application will oneday be multi language. It's very annoying to change those later...
[eluser]bas_vdl[/eluser]
[quote author="n0xie" date="1253740459"]I believe you have your model and controller mixed up Apart from the lack of form_validation rules, it seems fine by me (well obviously you would also want to do some data validation and sanitizing). One thing I would do is load the error and confirm message from a language file, if there is even the slightest chance the site/application will oneday be multi language. It's very annoying to change those later...[/quote] i'm using the form_validation.php config file to load the validation rules like valid_email, qequired etc. language file is a good idea! just looking into that! what do you mean with: sanitizing?
[eluser]n0xie[/eluser]
Data sanitizing means to filter any unwanted piece of input from any resource (for example an user filling in a form). CodeIgniter has some basic security measures in place but it's always a good thing to double check. This will explain a lot: http://mavrck.com/blog/2009/04/05/keepin...te-secure/ |
Welcome Guest, Not a member yet? Register Sign In |