I am using codeigniter 2.xx, and this is my view code:
<a href="users/user_info/<?=$row->user_name;?>/<?php echo $row->user_id;?>"></a>
And this is my controller code:
function user_info($name, $id)
{
$info['info'] = $this->user_model->user_info($id);
$data['content'] = $this->load->view('home',$info,true);
$this->load->view('template',$data);
}
When I click on the link I get this url: http://localhost/users/user_info/name/id
I want to remove last id segment so my url becomes: http://localhost/users/user_info/name
. How can I do this? I read about uri segment but it doesn't solve my question.