How to get all post data in Codeigniter
Before you have to do this long boring way to get all the post datas using Codeigniter.
$post = array(); foreach ( $_POST as $key => $value ) { $post[$key] = $this->input->post($key); } var_dump($post);Since CI 2.1.0, you can now do the following easy way to get all post data from the form.
$data = $this->input->post(NULL, TRUE); // returns all POST items with XSS filter $data = $this->input->post(); // returns all POST items without XSS filterThis can be handy if you have dynamically built form with a lot of fields and can't define each field's name. With this method you can get all post data from the form.
your blog is very helpful...click here to seeinsert data into database in Codeigniter
ReplyDeleteVery usefull!! ;)
ReplyDeletenice way when number of data is very large.
ReplyDeleteNice way thanks..
ReplyDeleteClick Here For Code-Igniter Interview Questions And Answer
Thx bro
ReplyDelete