Passing $Data to the Controller from View? - 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: Passing $Data to the Controller from View? (/showthread.php?tid=33314) |
Passing $Data to the Controller from View? - El Forum - 08-22-2010 [eluser]thesocialhacker[/eluser] Let's say i want to pass some data from the view back to the controller. how is this done, in the CodeIgniter way? Passing $Data to the Controller from View? - El Forum - 08-22-2010 [eluser]thesocialhacker[/eluser] any other ways except uri-segment(3)? i'd rather not have this exploitable by user? Passing $Data to the Controller from View? - El Forum - 08-22-2010 [eluser]mddd[/eluser] You shouldn't think of "sending from Controller to View". You probably mean sending information while requesting a new web page. You could do this through the url (www.example.com/controller/method/argument) or using a form to POST information to the page. In both occasions, there is no certainty of what a user can send. You must always check if the user's input is safe to use. Passing $Data to the Controller from View? - El Forum - 08-22-2010 [eluser]natefons[/eluser] the safest way i can think of, would be to pass it in a hidden POST. Passing $Data to the Controller from View? - El Forum - 08-22-2010 [eluser]basementDUDE[/eluser] if you just a need a product ID(small data) number, pass it thought URI. if you need a comments(large data) from user then you have to make a forum in the view and post it to the controller. Passing $Data to the Controller from View? - El Forum - 08-22-2010 [eluser]InsiteFX[/eluser] There is a third parameter to the view! Code: Returning views as data InsiteFX |