How to pass parameters in index function in codeigniter

后端 未结 12 1886
傲寒
傲寒 2020-12-14 03:02

here\'s an example of url: http://www.example.com/search/search-keyword

I am trying to make this work, I removed the index.php using .htaccess, search is the contro

12条回答
  •  暖寄归人
    2020-12-14 03:32

    • You need the index segment http://www.example.com/search/index/search-keyword.
    • Or you need to use a route $route['search/(:any)'] = 'search/index/$1';
    • Or you can look at remap

    Remember not to trust user input, especially when you are throwing it into your url. The latest version of CI supports $_GET variables now, so you may want to look into using that or flashdata. A searh term as simple as O' Brien will give you a fatal error ("The URI you submitted has disallowed characters.").

提交回复
热议问题