[eluser]java[/eluser]
Hi everybody! I have made 2 set of language, my problem is when i want to change the current language into another language : it's always back to main page (because i have created a controller named lang and this is its code:
Code:
class Lang extends Controller {
function Lang()
{
parent::Controller();
}
function index()
{
$cur_lang = $this->uri->segment(3);
if ($cur_lang=='english' OR $cur_lang=='vietnamese'){
$cookie = array(
'name' => 'lang',
'value' => $cur_lang,
'expire' => '86500',
'domain' => $this->config->item('cookie_domain'),
'path' => '/',
'prefix' => '',
);
set_cookie($cookie);
redirect('/home', 'refresh');
}else{
redirect('/home', 'refresh');
}
}
}
), i want when i standing on the current page(not main page) and change language, it's still stand on that page and not back to main page. How can i solve this problem? Thanks for any response.