12-17-2016, 02:56 AM
(This post was last modified: 12-17-2016, 03:12 AM by wolfgang1983.)
I am unable to redirect back to url I have set
When I am in http://localhost/myproject/newthread/1
And I echo out $forum_id id displays 1 which is correct.
I want to be able back to redirect('forum') . $forum_id;
http://localhost/myproject/forum/1
But for some reason when I redirect it does not add the variable I have set instead redirects to
http://localhost/myproject/forum/
How to make sure when redirect it can redirect with added uri segment
When I am in http://localhost/myproject/newthread/1
And I echo out $forum_id id displays 1 which is correct.
PHP Code:
<?php
class Newthread extends MX_Controller {
public function __construct() {
parent::__construct();
}
public function index() {
// Other data
// This will be in success part of form validation just redirect atm
$forum_id = $this->uri->segment(2);
redirect('forum') . $forum_id;
}
}
I want to be able back to redirect('forum') . $forum_id;
http://localhost/myproject/forum/1
But for some reason when I redirect it does not add the variable I have set instead redirects to
http://localhost/myproject/forum/
How to make sure when redirect it can redirect with added uri segment
Code:
$route['forum/(:num)'] = 'catalog/qna/forum/index/$1';
$route['newthread/(:num)'] = 'catalog/qna/newthread/index/$1';
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!