sensei. can you help me with my code? i wan to redirect page to the same page after edit it.
here is my controller
function edit_book(){
$editBook = array(
'id' => $this->input->post('id'),
'book_title' => $this->input->post('book_title'),
'category' => $this->input->post('category'),
'author' => $this->input->post('author')
):
$this->m_profile->edit_book($data1, $data, 'book_data');
redirect('app/book')
}
suppose im editing the data from page number 3. how can i redirect to page 3 (app/book/3) again after submit the edited data?
i have try to solve it by get URI value(suppose the page is app/book/3)<-- i need this '3'to put in redirect code. so i implement this code from many stackeroverflow answer, hope to get some array i can use
$url = "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
$escaped_url = htmlspecialchars( $url, ENT_QUOTES, 'UTF-8' );
$query_str = parse_url($escaped_url, PHP_URL_QUERY);
parse_str($query_str, $query_params);
print_r($query_params);
but it results array()or null. anyone can help me. thanks