CodeIgniter Forums
Make a dynamic uri segment - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Make a dynamic uri segment (/showthread.php?tid=61463)



Make a dynamic uri segment - anaklanang - 04-16-2015

How can i make my application URL like this "mysite/username/home" where the username is dynamically changed according to the user that register in my site, and also each user has their own home...
-thanks for answer-


RE: Make a dynamic uri segment - aurelien - 04-17-2015

Hi,

you can do it if you change the URL like this : http://mysite/home/username

PHP Code:
/* CONTROLLER HOME.PHP */
<?php
class Home extends CI_Controller {

 
  public function index($username)
 
  {
       // Check username
 
      // Load view
 
      // ...
 
  }





RE: Make a dynamic uri segment - InsiteFX - 04-17-2015

SEE: Also _remap method