Welcome Guest, Not a member yet? Register   Sign In
Route URL with GET parameters to cleaner URL
#4

[eluser]drewbee[/eluser]
Hi Vendiddy,

I set up a referral system on one of my CI sites, which allowed the user to take any page / controller / method etc and attach a ?ref=userid to it.

What I did assumes that query_string is still set to OFF for CI.

in the pre_controller hook, you can still process $_GET as CI hasn't gotten ahold of it yet.

Here is what I would do: at this point in time there are only two classes loaded for CI, so you have to use native PHP code for everything
I would actually recomend only having this run on the page that can accept this as well.
pre_controller hook:
Code:
if (isset($_GET['token']))
{
    header("Location: /umdcal.php/application/test/" . urlencode($_GET['token']));
    unset($_GET['token']);
}

... or if you think of something else besides a header redirect. Make sure you do the unset() though, that way CI doesn't see it, as it would throw a 404 as you are currently experiencing.


Messages In This Thread
Route URL with GET parameters to cleaner URL - by El Forum - 10-01-2008, 11:42 PM
Route URL with GET parameters to cleaner URL - by El Forum - 10-02-2008, 05:53 AM
Route URL with GET parameters to cleaner URL - by El Forum - 10-02-2008, 10:58 AM
Route URL with GET parameters to cleaner URL - by El Forum - 10-02-2008, 02:35 PM
Route URL with GET parameters to cleaner URL - by El Forum - 10-02-2008, 02:40 PM
Route URL with GET parameters to cleaner URL - by El Forum - 11-01-2008, 02:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB