【发布时间】:2017-03-17 04:07:15
【问题描述】:
大家好,我想问一些关于如何直接链接获取 uri 段的问题。在我的网络应用程序中,我会像这样与 get uri 段建立直接链接
http://localhost/ttaportal/ref_application/manage_access/18
我有一个控制器
function insert_access(){
$id = $this->uri->segment(3);
$refAppAccess = $this->input->post('accessId');
$refApplicationId = $this->input->post('appId');
$refDepartmentId = $this->input->post('deptId');
$data = array(
"refApplicationId" => $refApplicationId,
"refDepartmentId" => $refDepartmentId
);
$action = $this->ref_application_model->insert_access($data);
if($action == 1) {
$this->session->set_flashdata('message', 'Application access has been added successfully');
}
else {
$this->session->set_flashdata('message', 'Failed to add application access');
}
redirect(base_url() . 'ref_application/manage_access/'.$id, 'refresh');
}
我已经尝试过了,但总是重定向到
http://localhost/ttaportal/ref_application/
我真的需要帮助。谢谢:)
【问题讨论】:
标签: php model-view-controller uri url-redirection codeigniter-3