I have some syntax in my controller:
$data = array(
'submit' =>$this->input->post('submit'),
'period' =>$this->input->post('period'),
'buom' =>$this->input->post('buom'),
'creditlimit' => $this->sales_model->get_creditlimit($this->input->post('customer'))
);
This works perfect when I pass it to my view, all the array elements become variables as intended.
what I want to do though is use $this->input->post('submit')
in an if statement but $this->input->post('submit')
does not output to the controller itself, only the view.
if I simply do the following:
echo $this->input->post('submit');
PHP returns no value even thought the post is being displayed normally by the view?
how can I make this post value available to my controller and perform logic against it.
my overall objective is that my submitting form has three different submit buttons. Depending on the submit button they click I would like to load a different view for each submit.
so something like:
if($this->input->post('submit')==="option1")
{$this->load->view('view1');}
else
{$this->load->view('view2');}
Am I do something stupid?
Thanks in advance as always, Regards...
$data
and passing that to view works fine. so just not available to controller.