Simple Search: Passing Form Variable to URI Using CodeIgniter

前端 未结 5 1201
旧巷少年郎
旧巷少年郎 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:31

    Here is the best solution:

    $uri = $_SERVER['REQUEST_URI'];
    
    $pieces = explode("/", $uri);
    
    $uri_3 = $pieces[3];
    

    Thanks erunways!

提交回复
热议问题