I am trying to post value in a hidden form but. I am unable to get the value in controller, I am new to codeigniter nd I am not sure whether I am doing the right thing.
My view is:
<tbody>
<?php foreach ($users as $user):
$id= $user['id']; ?>
<tr>
<td><?php echo $user['name'];?></td>
<td><?php echo $user['sum_cmmnt'] ?>
<form class="add_cm" action="<?php echo base_url();?>comments/cmnt/" name="comm" method="post" >
<a href="#" data-toggle="modal" data-target="#manage_cmnt">
<input type="button" class="btn" name="user_id" value="<?php echo $id; ?>"/>
clicking on this button will open a pop-up window with all listed comment of user. When I am using fixed Id value it is working but using this it is unable to post the value in controller.
My controller is:
public function index()
{
$this->load->model('modl_name');
$id = $this->input->post('user_id');
$this->data['users']=$this->modl_name->function($id);
I am not getting the value here in my controller. If I am using fixed value here its working fine.
Please help me...on this or suggest me other option if this is not right..