Simple Search: Passing Form Variable to URI Using CodeIgniter

前端 未结 5 1203
旧巷少年郎
旧巷少年郎 2021-02-06 17:49

I have a search form on each of my pages. If I use form helper, it defaults to $_POST. I\'d like the search term to show up in the URI:

http://examp         


        
5条回答
  •  一整个雨季
    2021-02-06 18:28

    There's a better fix if you're dealing with people without JS enabled.

    View:

    
       
    
    

    Controller

    input->post('keyword'));
        }
    
        function search()
        {
            // do stuff;
        }
    ?>
    

    I have used this a lot of times before.

提交回复
热议问题