08-04-2010, 05:25 PM
[eluser]7amza[/eluser]
hey how are you dears? wish fine.
i used the Hybrid session library instead of the original coming with CI by default.
so it works fine with me in localhost . but when i upload it , it dosen't work .
i use it to change the style from basic style (for low connexion) to noraml(with pics).
these is my helper (autoload it)
the controller method:
the switcher method :
i have to views :
home.php
basichome.php
the link : http://domain.ext/folder/home/SetStyle/basic should change the mode to the basic!
so in localhost it works fine but when i upload it to my online website it don't work !!
any solution?
hey how are you dears? wish fine.
i used the Hybrid session library instead of the original coming with CI by default.
so it works fine with me in localhost . but when i upload it , it dosen't work .
i use it to change the style from basic style (for low connexion) to noraml(with pics).
these is my helper (autoload it)
Code:
<?php
function getCurrentStyle(){
$wadae =& get_instance();
$style = $wadae->session->userdata('currentstyle');
if(!($style == 'basic')){
setStyle('');
return '';
}
else{
$style = 'basic';
}
return $style;
}
function setStyle($mode){
$wadae =& get_instance();
$wadae->session->set_userdata('currentstyle',$mode);
}
the controller method:
Code:
function index(){
//Count Fields
$data['categoriesField'] = $this->gadget->countField('categories');
$data['sitesField'] = $this->gadget->countField('sites');
$data['viewsField'] = $this->gadget->getField('views');
//categories
$data['categories'] = $this->category->getCategories();
//pages
$data['pages'] = $this->gadget->getPages();
//adsenses
$data['adsenses'] = $this->gadget->getAdsenses();
//blocks
$data['blocks'] = $this->gadget->getBlocks();
//articles
$data['articles'] = $this->article->getArticles(3);
//load views
$this->load->view('header',$data);
$this->load->view('menu',$data);
$this->load->view(getCurrentStyle().'home',$data);
$this->load->view('footer',$data);
}
Code:
function SetStyle(){
$mode = $this->uri->segment('3');
if($mode == FALSE){
redirect($_SERVER['HTTP_REFERER']);
}elseif($mode == 'basic'){
setStyle($mode);
}elseif(!($mode == 'basic')){
setStyle(NULL);
}
redirect($_SERVER['HTTP_REFERER']);
}
home.php
basichome.php
the link : http://domain.ext/folder/home/SetStyle/basic should change the mode to the basic!
so in localhost it works fine but when i upload it to my online website it don't work !!
any solution?