[eluser]Unknown[/eluser]
I have a view with 3 forms with the action attribute set to
/controller/submit for all of the forms. For the controller, I check ($this->input->post('submit_name')) to manage correctly the data for the specific submitted form.
If there are any errors, I reload the view calling
$this->index();
If there aren't, I add into the database some records and I also call
$this->index();
My question is:
It is possible to send a $message to the view if the form is submitted correctly?
(e.g. for every input->post('submit_name') set a custom message like 'That form has been submitted correctly');
I tried something like this:
In the view I added
Code:
if (@$message) echo $message;
Note the '@' sign. If $message is not set, it won't echo out any notifications about $message.
If the form is submitted:
Code:
$data['message'] = 'The category has been added successfully!';
$this->load->view('same/view', $data);
I don't know why, the message doesn't appear. (and some errors do appear).
Please let me know if you tried something like this and found a solution.
Thanks