Passing $Data to the Controller from View? |
[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?
[eluser]thesocialhacker[/eluser]
any other ways except uri-segment(3)? i'd rather not have this exploitable by user?
[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.
[eluser]natefons[/eluser]
the safest way i can think of, would be to pass it in a hidden POST.
[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.
[eluser]InsiteFX[/eluser]
There is a third parameter to the view! Code: Returning views as data InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |