Welcome Guest, Not a member yet? Register   Sign In
How to pass data from a view to a controller?
#9

[eluser]theciman[/eluser]
Maybe it's me and yes I am knew to html and php, CI, etc. But while I was waiting for an answer I did the following:

Changed my code in the view to:
$id_name = 'ProjectID';
echo form_hidden($id_name, $row->$id_name); // simple -- name_id is "ProjectID" and value is ($row->$id_name) which is "5"

My controller has the following code:
$project_id = $this->input->post("ProjectID");
echo $project_id;

Then I printed out the html code:
<input type="hidden" name="ProjectID" value="5" />

Guess what I get nothing on the echo $project_id! So what could be wrong with the code listed above?


Messages In This Thread
How to pass data from a view to a controller? - by El Forum - 02-12-2010, 10:17 AM
How to pass data from a view to a controller? - by El Forum - 02-12-2010, 10:20 AM
How to pass data from a view to a controller? - by El Forum - 02-12-2010, 10:37 AM
How to pass data from a view to a controller? - by El Forum - 02-12-2010, 11:46 AM
How to pass data from a view to a controller? - by El Forum - 02-12-2010, 11:52 AM
How to pass data from a view to a controller? - by El Forum - 02-12-2010, 12:09 PM
How to pass data from a view to a controller? - by El Forum - 02-15-2010, 11:46 AM
How to pass data from a view to a controller? - by El Forum - 02-15-2010, 11:59 AM
How to pass data from a view to a controller? - by El Forum - 02-15-2010, 12:22 PM
How to pass data from a view to a controller? - by El Forum - 02-15-2010, 12:35 PM
How to pass data from a view to a controller? - by El Forum - 02-15-2010, 12:37 PM
How to pass data from a view to a controller? - by El Forum - 02-15-2010, 01:05 PM
How to pass data from a view to a controller? - by El Forum - 02-15-2010, 01:24 PM
How to pass data from a view to a controller? - by El Forum - 02-15-2010, 01:34 PM
How to pass data from a view to a controller? - by El Forum - 02-15-2010, 01:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB