Welcome Guest, Not a member yet? Register   Sign In
Concept Question
#3

[eluser]pistolPete[/eluser]
A very common approach is the following:

1.) user submits the form
2.) redirect to search/results/{keyword}

Look at the forum search, it's done very similar.

controller:
Code:
class Search extends Controller {

    function do_search()
    {
        $this->load->helper('url');
        $keyword = $this->input->post('keyword')
        redirect('/search/results/'.$keyword);
    }
    
    function results($keyword)
    {
        // do the actual searching here
        // query db, load views, etc.
    }

}

view:
Code:
<form action="/search/do_search/" method="POST">
<input type="text" name="keyword" />
<input type="submit" value="Search!">
</form>


Messages In This Thread
Concept Question - by El Forum - 03-14-2009, 04:14 PM
Concept Question - by El Forum - 03-14-2009, 04:17 PM
Concept Question - by El Forum - 03-14-2009, 04:33 PM
Concept Question - by El Forum - 03-14-2009, 06:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB