• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with query string parameters

I need to get the query string parameters from a url that twitter sends to me:


When I recive this request I get a 302 error and I'm redirected to: http://localhost:8888/marnews/index.php/dashboard/access_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
echo $this->input->get('oauth_token');
but I think that when I'm redirected and I loose this data.

Do you know how to fix this?

Thanks in advance.

You should use post methods, if this is a form. If not, just make your URL something like

And then you can use the uri helper, and grab the segment(n) respective to each one.

$token = $this->uri->segment(3);
$veri = $this->uri->segment(4);

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.

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.

Ha. Totally didn't even think about that. But for Twitter... http://codeigniter.com/wiki/OAuth_for_Twitter/


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:

$config['uri_protocol'] = 'QUERY_STRING';
$config['enable_query_strings'] = TRUE;

If you don't change it and use query strings you will be redirected (Error 302).

Thanks for all Smile

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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