Welcome Guest, Not a member yet? Register   Sign In
can i access post request data in the controller?
#1

[eluser]plainas[/eluser]
Maybe i am missing something in here.
Code:
$this->input->post("var");

is it only acessible in the views?
That's not so practical to handle forms.

I want to set the action of a post form to a controller, and then, according on the data provided, direct the user to the apropriate view.
#2

[eluser]gtech[/eluser]
it works in the controller also, infact I usually use it in the controllers.

so here are the steps

.you post to the controller from your view
.in the controller you retrieve the form vars using $this->input->post("var");
#3

[eluser]Michael Wales[/eluser]
Agreed - I never even thought to use it in a view (or how that would be useful).
#4

[eluser]CI Lee[/eluser]
However.... one could use that to implement a two click process to prevent spam. Display a second button to click before processing.

-Lee
#5

[eluser]plainas[/eluser]
I have no idea what i missed yesterday, today i can fetch post values very easily.
I should have missed a character or something. Sorry.
Thank you all.




Theme © iAndrew 2016 - Forum software by © MyBB