url routing issue |
[eluser]learnq[/eluser]
Hi, I have url like http://127.0.0.1/blog/urltest/7987 Code: class Blog extends Controller { I can get the value 7987. now when I route Code: $route['utest/:num'] = "blog/urltest/$i"; and http://127.0.0.1/utest/7987 I donot get 7987 . Again if I have a url like http://127.0.0.1/blog/urltest/7987/theprodname how do I get 7987 and theprodname What is wrong ? Please help. Thanks.
[eluser]Natebot[/eluser]
Code: $route['utest/(:num)'] = 'blog/urltest/$1'; I think you use parentheses around the wildcard to designate the matched content to be passed to the function.
[eluser]Hazlitt[/eluser]
The $this->uri->segment(n) function can help you get the different segments of the url. This article may help: http://ellislab.com/codeigniter/user-gui...s/uri.html
[eluser]learnq[/eluser]
Hi, Thanks for the replies .I have fixed the problem. |
Welcome Guest, Not a member yet? Register Sign In |