codeigniter url routing with query string -


i have 2 url in project

http://example.com/one.html

http://example.com/one.html?param1=value&param2=value

in route file have rules below

$route['search/one?(:any)'] = 'advance_search/books'; $route['search/one'] = 'advance_search/index'; 

when call 2nd url query string still call index method. 1 fix wrong.

try route like

http://example.com/index.php/controller_name?param1=value&param2=value 

controller has php file

make sure first letter upper case on class , file name.

controllers/one.php

<?php  class 1 extends ci_controller {      public function index() {        echo $this->input->get('param1');       } } 

if need remove index.php try of these htaccess

https://github.com/wolfgang1983/htaccess_for_codeigniter


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -