User profile page

Hello all.

I use Dx Auth for user authentication. So the users can log-in and log-out etc. Now I would like to give every user their own profile page with the following URL structure:

But I don't understand how to get all the usernames in the last segment.

Anyone who can point me in the right direction?

[eluser]Michael Wales[/eluser]
$route['profile/([A-Za-z0-9-]+)'] = 'profile/view/$1'
URI Routing

Put this in your routes.php file

$route['profile/:any'] = "profile";

This means anything after the profile segment will go to the profile controller.

Then in your controller, you can do something like this

if($this->uri->segment(2) == TRUE)
    echo 'do something with the url';
    echo 'do something else if there is no second segment';

Hope this helps


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.