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

[eluser]gcc.programmer[/eluser]
Here's the thing:

Your code for the controller:
Code:
function update_project()
{
  $project_id = $this->input->get(‘ProjectID’);
  echo $project_id;
{

As was stated, you need to change the input function to POST:
Code:
$project_id = $this->input->post('ProjectID');



your code for the view:
Code:
echo form_open(‘test/update_project’);

$id_name = ‘ProjectID’;
$hidden_value = array(‘name’ => $id_name, ‘id’ => $id_name, ‘value’ => $row->$id_name); //note $row->$id_name contains the table id I need which is there and valid
echo form_hidden($hidden_value);  //pass the ID with a hidden form


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