• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.