Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Show user with id
#1

(This post was last modified: 01-02-2018, 11:15 AM by wendaf.)

Hello
I have another problem i want to show a user page like : monsite.com/user/1 but i can't i search for several hours on forum etc ...

My code : 


It my user controller
PHP Code:
   public function index($id FALSE){
        
 
       $data['user'] = $this->user_model->get_account($id);
        
$this->load->view('layout/header');
 
       $this->load->view('user/user' $data);
 
       $this->load->view('layout/footer');
 
   


And my model :

PHP Code:
    public function get_account($id)
    {
     
 $query $this->db->where('guid',$id)->get('accounts');
     
 return $query->row();
    } 


And i add this in my route :

PHP Code:
$route['user/(:num)'] = "user/user/$1"


and all time when i go to monsite.com/user/1 he say 404 not found 

i have create a views in user/user .

Thanks for help  Shy
Reply
#2

Please see the CodeIgniter User Guide

SEE:

Remapping Method Calls
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(This post was last modified: 08-03-2017, 10:02 AM by wendaf.)

solved thanks you can closed the thread
Reply
#4

Just edit your topic and add [SOLVED} in the title.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB