CodeIgniter Forums
form being skipped when I run controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: form being skipped when I run controller (/thread-51162.html)



form being skipped when I run controller - El Forum - 04-23-2012

[eluser]bill19[/eluser]
Hi everyone,

I have a preexisting form that I'm trying to use to collect some data. It seems that my controller bypasses my form completely and the $_POST array is never set. Finally at the end of the script the form appears. Obviously the sequence is wrong. How can I get the order right?

Thanks in advance,

KC



Here is my controller:

Code:
public function index()
{
  $this->load->view('addlisting'); // PREEXISTING FORM
                $this->load->model('newform');
                
                if (isset ($_POST)) {
                
                $this->newform->index();
                
                }
}

here is the model:

Code:
function index() {
        
      
        var_dump($_POST);  

}



form being skipped when I run controller - El Forum - 04-23-2012

[eluser]boltsabre[/eluser]
Check out the documentation, you're missing lots of things by the look of it
http://ellislab.com/codeigniter/user-guide/libraries/form_validation.html


form being skipped when I run controller - El Forum - 04-23-2012

[eluser]bill19[/eluser]
I have looked at that , but I'll check it out again