CodeIgniter Forums
Missing variables via URL - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Missing variables via URL (/thread-55224.html)



Missing variables via URL - El Forum - 10-16-2012

[eluser]rmartinez[/eluser]
Hi everybody,

When I write a url like http://midominio.com/auth_other/l?oauth_token=87647ee3-abf1-42eb-aec3-58656dedd3a7&oauth_verifier=08666, the url chagnes to http://midominio.com/auth_other/l automatically, why? However, if I write http://midominio.com/auth_other/l?oauth_verifier=08666&another_variable=999, it works fine, ??

My config.php file:
$config['index_page'] = '';
$config['uri_protocol'] = 'PATH_INFO';
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-\?\=\#\&';
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = FALSE;
$config['global_xss_filtering'] = FALSE;

Mi htaccess file:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|captcha|pruebas|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

Thanks.

Regards.


Missing variables via URL - El Forum - 10-17-2012

[eluser]Mr. Pickle[/eluser]
Few idea's:
- Enable query strings in the config
- Add [L,QSA] to the htaccess (instead of only L)

Don't know if it makes a difference but it's worth the try Smile


Missing variables via URL - El Forum - 10-17-2012

[eluser]rmartinez[/eluser]
Hi Mr. Pickle

I tried all those things but they didn´t fix anything.

Could be the problem something about the lenght of the URL, some characters in it or both?

Thanks for your answer.

Regards.


Missing variables via URL - El Forum - 10-17-2012

[eluser]Mr. Pickle[/eluser]
Is your server supporting PATH_INFO?
You can try to look at this by dumping the server variable:
Code:
var_dump($_SERVER)

If not, try to set this in the config file (if you're getting ORIG_PATH_INFO):
Code:
$_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];

Now you can set (or in your case leave) the uri_protocol to PATH_INFO
Code:
$config['uri_protocol'] = 'PATH_INFO';

Hope it helps!


Missing variables via URL - El Forum - 10-17-2012

[eluser]rmartinez[/eluser]
var_dump($_SERVER) doesn´t show PATH_INFO neither ORIG_PATH_INFO in my server.

Does it make sense that the uri_protocol is setted to PATH_INFO??



Missing variables via URL - El Forum - 10-17-2012

[eluser]Mr. Pickle[/eluser]
It certainly explains why the query parameters don't work.
You can also try to set uri_protocol to AUTO.


Missing variables via URL - El Forum - 10-17-2012

[eluser]rmartinez[/eluser]
Well, in fact, I tried diferents types for uri_protocol and only in some of them the query parámeters worked. Buy when they worked, the aplication removed them in some cases and that is my question, why the aplication only remove the query parameters in some cases?