How to screen $_POST data before inserting into database? |
[eluser]Tony W[/eluser]
I am very new to CI and just started coding. I have read the user guide but still don't know how to do screen the POST data before saving to database? I only know this for mysql insertion: $this->db->insert('db_table', $_POST); How do you screen the data such as: confirm if the passwords (1st entry and confirm) are identical? add captcha. etc... Thanks!
[eluser]Taff[/eluser]
Hey Tony, check out the validation class. http://ellislab.com/codeigniter/user-gui...ation.html That should be what you need. Scroll down to Prepping data where you will see Quote:$rules['username'] = "trim|required|min_length[5]|max_length[12]|xss_clean"; which will give you a basic idea of how it works. Taff |
Welcome Guest, Not a member yet? Register Sign In |