how to get all post data - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: how to get all post data (/showthread.php?tid=32808) |
how to get all post data - El Forum - 08-05-2010 [eluser]Arun Joshi[/eluser] I have a dynamically built form. And there is lot of controls. I cant define each controls name initially. In this case when I submit form, how can i get all the post data from that form? similarly Code: var_dump($_POST); I searched in the form. But cant find a solution for this. Thanks Arun how to get all post data - El Forum - 08-05-2010 [eluser]pickupman[/eluser] You may find this command helpful Code: $this->output->enable_profiler(TRUE); This will output every query, $_REQUEST variable, memory, time, uri. Very helpful for developing. You can using something like Code: $this->input->post('field_name'); how to get all post data - El Forum - 08-06-2010 [eluser]Arun Joshi[/eluser] I tried Code: var_dump($this->input->post()); But its not working. I really struck here. any other solution??? how to get all post data - El Forum - 08-06-2010 [eluser]WanWizard[/eluser] You can't call the post() method that way, you can't iterate over it using a foreach either. post() requires an index name, if not given (of if it doesn't exist), it returns FALSE, which is probably what your var_dump() output is showing. What you can do is: Code: $post = array(); Would be a handy addition to the Input library... how to get all post data - El Forum - 08-06-2010 [eluser]Arun Joshi[/eluser] Thanks... I have added that to my library... how to get all post data - El Forum - 01-29-2012 [eluser]kanjimaster[/eluser] I use this extension of the Input class. The code is similar to WanWizard's. Just place the code in a file application/core/MY_Input.php. Code: <?php defined('BASEPATH') OR exit('No direct script access allowed'); and call by inserting Code: $this->input->dump_post(); how to get all post data - El Forum - 01-29-2012 [eluser]InsiteFX[/eluser] CI 2.1.0 Code: $data = $this->input->post(NULL, TRUE); // returns all POST items with XSS filter how to get all post data - El Forum - 01-29-2012 [eluser]kanjimaster[/eluser] Sweet. That's one less file to add to each project. Thanks for the update. how to get all post data - El Forum - 09-15-2012 [eluser]minnieso[/eluser] Hummm.. |