Problems with query string parameters |
[eluser]joanfihu[/eluser]
I need to get the query string parameters from a url that twitter sends to me: http://localhost:8888/marnews/index.php/...XXXXXXXXXX When I recive this request I get a 302 error and I'm redirected to: http://localhost:8888/marnews/index.php/...cess_token (Notice that is the same url without query string parameters) Do you know any way to get this parameters without enabling query strings? I'm using Codeigniter Reactor 2.0.2 I've tried to do Code: echo $this->input->get('oauth_token'); Code: print_r($_SERVER) Do you know how to fix this? Thanks in advance.
[eluser]regal2157[/eluser]
You should use post methods, if this is a form. If not, just make your URL something like http://localhost:8888/marnews/index.php/...XXXXXXXXXX And then you can use the uri helper, and grab the segment(n) respective to each one. E.G. Code: <?php If you want to use the GET method, you have to do some editing in other files to make it work. I would just stay away from it.
[eluser]bretticus[/eluser]
Of course that is if you actually have the choice of specifying your URI with twitter. I still hate that CI squashes this. There are some work arounds. If you can do what @regal2157 suggests, go for it! If you can't, lemme know.
[eluser]regal2157[/eluser]
Ha. Totally didn't even think about that. But for Twitter... http://codeigniter.com/wiki/OAuth_for_Twitter/
[eluser]joanfihu[/eluser]
Hi, I'm already using this library. I've fixed the problem. Seems that if you want to use query strings in CI 2.0.2 you have to change this lines in config.php: Code: $config['uri_protocol'] = 'QUERY_STRING'; If you don't change it and use query strings you will be redirected (Error 302). Thanks for all ![]() |
Welcome Guest, Not a member yet? Register Sign In |