Possible Duplicate:
Change url in php after reloading a page
I might be repeating my question but i am providing the exact scenario this time with my actual code Kindly be patient with me ... My Home page URL is
http://localhost/mediabox/home/box/12
on my home page I have two links for languages when I click on any of the link the page reloads with the content in that specific language.
The link is inside a view (template/index) and looks like this
<a href="<?php echo base_url(); ?>home/box/?bid=<?php echo $template_data['box_id']?>&ln=<?php echo $lang['language_id']?>"></a>
So i am sending bid and ln as qurystring with the link
Now when I click on the link the content of the page changes according to the language selected but the url also changes to
http://localhost/mediabox/home/box/?bid=12&ln=2
What i want is that the content of the page changes but not the url or can I make the url looks like this after loading the page
http://localhost/mediabox/home/box/12/language_name
The method in my controller that loads the home page and change the content when a language link is clicked is as follows
public function box() {
$url = $this->pageURL();
$id_from_url = explode('/', $url);
if (isset($_GET['bid'])) {
$id = $this->input->get('bid');
}
else{
$id = $id_from_url[6];
}
$query = $this->db->get_where('mc_boxes', array('idmc_boxes' => $id));
$row = $query->row();
if (isset($_GET['bid'])) {
$box_id = $this->input->get('bid');
}
else {
$box_id = $row->idmc_boxes;
}
$customer_id = $row->customers_idcustomers;
if (isset($_GET['ln'])) {
$language_id = $this->input->get('ln');
}
else {
$language_id = $row->languages_idlanguages;
}
$template_id = $this->Home_model->getTemplateID($box_id);
$data['template_data'] = $this->Home_model->getTemplateData($template_id);
$data['variables_data'] = $this->Home_model->getVariables($customer_id, $language_id);
$data['titles_data'] = $this->Home_model->getTitles($box_id,$language_id);
$data['categories'] = $this->Home_model->getCategories($customer_id, $language_id);
$data['languages'] = $this->Home_model->getLanguages($box_id);
$this->load->view('template/index', $data);
}
Any ideas please ?
Thanks in advance
:)