![]() |
Passing affiliate ID on ANY url, friendly url's and query string together - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Passing affiliate ID on ANY url, friendly url's and query string together (/showthread.php?tid=16413) |
Passing affiliate ID on ANY url, friendly url's and query string together - El Forum - 03-05-2009 [eluser]Unknown[/eluser] My apologies if this has been asked already, but I cannot find the answer. I am currently running a site using CI friendly urls and everything is peachy. I'm adding an affiliate system, and would like members to be able to pass in their affiliate IDs using ANY url. eg. http://www.mysite.com/controller/method1/param1/param2?a=123456 OR http://www.mysite.com/controller/method2?a=123456 etc. Where 123456 is their ID. I figure this would be easiest to accomplish with the query string, and having every controller check for it when it loads, and set a session variable. Reading the user's guide, it seems like it is only possible to use either the query string or friendly URLs, not both. Has anybody accomplished something similar to this and care to share their solution? Or at least point me to an appropriate thread which discusses the topic? Thank you kindly in advance. Passing affiliate ID on ANY url, friendly url's and query string together - El Forum - 03-05-2009 [eluser]TheFuzzy0ne[/eluser] I wanted a way to use key-value pairs without using query strings, so I wrote an [url="http://ellislab.com/forums/viewthread/106502/"]Alternate URI Syntax library[/url]. It might help you. Passing affiliate ID on ANY url, friendly url's and query string together - El Forum - 03-05-2009 [eluser]Unknown[/eluser] Thank you for the reply TheFuzzy0ne, your library is great, I'll probably use it for another part of my site. Unfortunately, it doesn't do exactly what I need in this case. The good news is I've found another solution, for anyone interested -> http://ellislab.com/forums/viewthread/56389 Passing affiliate ID on ANY url, friendly url's and query string together - El Forum - 03-05-2009 [eluser]TheFuzzy0ne[/eluser] Thanks for posting your solution, and welcome to the CodeIgniter community. ![]() Passing affiliate ID on ANY url, friendly url's and query string together - El Forum - 03-06-2009 [eluser]tomcode[/eluser] Sticking with CI friendly urls You could could add as LAST pair /myident/123456 and then check the presence of the myident segment in every controller. |