How to check if form was submitted in the view - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to check if form was submitted in the view (/showthread.php?tid=48603) |
How to check if form was submitted in the view - El Forum - 01-22-2012 [eluser]landitus[/eluser] I'm trying to do the following: I would like to have 1 view that is used for the form and the form validation and the form success as well. I'm using flashdata to inform the user about the process. But I would like to check wether or not the following code in the view is considered safe and good practice. I placed this line: Code: $this->session->set_flashdata('exito', 'some message'); form_view.php Code: <!-- Flash Data --> How to check if form was submitted in the view - El Forum - 01-23-2012 [eluser]Aken[/eluser] Unless you are redirecting after the form is processed, you don't need session data. Just pass a variable to your view like you would any other data, and give it a true or false value saying whether or not the form was processed successfully. |