Welcome Guest, Not a member yet? Register   Sign In
Problem with _remap function (trying to redirect) [SOLVED]

Hi all,

I have just started using CI about 2 days ago, and have come into a problem with the _remap function. I'm trying to redirect anything off the 'www.root.com/username' to 'www.root.com/profile/username', and have no idea where I'm going wrong - Any help will be appreciated.


class Home extends Controller {
    function _remap($username)
        $is_user = $this->Home_model->is_valid_user($username);
        echo $is_user;
        if($is_user == true):
            header('Location: /profile/' . $username);
            $data = array();
            $data['lastjoined'] = $this->Home_model->get_last_joined(3);
            $data['representing'] = $this->Autoload_model->get_socialnetworks('random',10);
            $data['randomtip'] = $this->Autoload_model->get_random_tip();
            $data['latestnews'] = $this->Autoload_model->get_latest_news(3,50);



class Home_model extends Model {
    function get_last_joined($limit = '10')
        $this->db->join('country', 'user.country_id = country.id');
        $query = $this->db->get();
        return $query->result();
    function is_valid_user($username = '')
        $this->db->where('user_name', $username);
        if($this->db->count_all_results() < 1):
            return false;
            return true;

Apologies for the crappy code ;p

Messages In This Thread
Problem with _remap function (trying to redirect) [SOLVED] - by El Forum - 11-05-2009, 09:04 AM

Theme © iAndrew 2016 - Forum software by © MyBB