• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to put username after domain name

#1
[eluser]teddy[/eluser]
I saw some website deal/groupon can put username after domain name example: www.xyz.com/abc and in my website I want allow some users register nickname and they can post some deals/groupon they want and they access or views these posted by them throught out url like this: www.xyz.com/abc

Futher more how can I show a deal time with day, hour , minute decrease on web page with deal time decrease

Thank you for reading my topic

#2
[eluser]CroNiX[/eluser]
You can do this with routes, but it would be a bit complicated because you'd be breaking the default way CI maps the url to a controller/method (there would be no controller/method in the url). So you'd need to create a route for every controller that you use, and then at the very end of them have a catch-all route like
$route['(:any)'] = 'controller/method/$1';
Where it would pass whatever was after the domain name in the URL to the 'controller/method' that you want to use.

You need all of the other controllers mapped before that route though, or no other controller could be accessed since it will send everything to that one controller that you want to use to display the profile (or whatever).

#3
[eluser]teddy[/eluser]
@CroNiX: thank you for your fast reply, I will trying about routes

#4
[eluser]cartalot[/eluser]
if you can deal with one extra word in the URL it will greatly simplify what you want to do
something like 'users'

www.xyz.com/users/abc

and then set up a route like
$route['users/(:any)'] = "users/display";

where your controller is called users, with a method called display, that searches for the user and displays them.
note that - whats cool is that the route can direct to any controller and method, it doesn't need to be the same name,

$route['users/(:any)'] = "customers/find";

#5
[eluser]InsiteFX[/eluser]
CodeIgniter User Guide - Remapping Function Calls

#6
[eluser]teddy[/eluser]
@insiteFX: I will try Remapping Function Calls tk for your reply

#7
[eluser]PhilTem[/eluser]
Have a look at the appended link, that might give you another approach to solving your problem Wink

https://gist.github.com/4157418

#8
[eluser]teddy[/eluser]
I think the solution is here: http://ellislab.com/forums/viewthread/186025/


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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