Welcome Guest, Not a member yet? Register   Sign In
changing / rewriting the URI
#3

[eluser]Mirage[/eluser]
What I do is to stick the cleaned Post data into a session variable, and read it out in the redirected method and use the url parameters to communicate paging

Code:
function listing($page=0) {
    if($_SERVER['REQUEST_METHOD']=='POST') {
        // sanitize post data
        $listingParams = $this->sanitize_post_data();
        
        if ($listingParams) {
            $this->session->set_userdata('listingparams', listingParams);
            header("Location: {$_SERVER['PHP_SELF']}";
            exit();
        }
    }

    // handle GET requests
    $listingParams= $this->session->userdata('listingparams');

    // redirect to the form if nothing was stored

    // else do the search

    // show the results view
    
}

HTH,
-m


Messages In This Thread
changing / rewriting the URI - by El Forum - 09-14-2008, 12:42 PM
changing / rewriting the URI - by El Forum - 09-14-2008, 01:46 PM
changing / rewriting the URI - by El Forum - 09-14-2008, 03:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB