CodeIgniter 启用查询字符串 [英] CodeIgniter Enabling Query Strings

查看:31
本文介绍了CodeIgniter 启用查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了这个网址:

http://twitternieuws.com/class/function/ID?oauth_token=xxxxx&oauth_verifier=xxxxx

而且我不断收到错误消息,例如未找到您请求的页面"或您提交的 URI 不允许使用字符".我尝试使用不同的设置更改以下选项:

And I keep getting errors like "The page you requested was not found" or "The URI you submitted has disallowed characters". I tried changing the following options with different settings:

$config['permitted_uri_chars'];
$config['enable_query_strings'];
$config['uri_protocol'];

有什么我可以做的事情吗?我正在使用 codeigniter 1.7.2

Is there anything I can do to make it work? I am using codeigniter 1.7.2

推荐答案

1.7.2 中的查询字符串是个笑话,它使用 ?c=controller&m=method 基本上改变你漂亮的 url伪 $_GET 参数.我真的不明白为什么有人会按照预期的方式使用它,它非常具有误导性,并且与普通查询字符串不同.

Query strings in 1.7.2 are a joke, it uses ?c=controller&m=method to basically change your pretty urls to psuedo $_GET params. I really can't see why anyone would use it the way it's intended, it's very misleading and is not the same as normal query strings.

强烈建议您查看最新版本的 Codeigniter,它们不会取消设置 $_GET 数组(现在可以使用普通查询字符串).在旧版本的核心文件之一中,它说 CI 不使用 $_GET 所以我们将 unset() 全局 $_GET 数组.那么,如果需要使用 $GET 怎么办?我一直认为这很疯狂,人们一直在为真正的 $_GET 支持永远尖叫.

I highly suggest you check out the latest version of Codeigniter, where they do not unset the $_GET array (normal query strings are now usable). In one of the core files in the older versions it says CI does not use $_GET so we are going to unset() the global $_GET array. Well, what if I need to use $GET? I always thought it was crazy, and people have been screaming for true $_GET support for forever.

说真的,是时候升级了:

Seriously though, it's time to upgrade:

最新:https://bitbucket.org/ellislab/codeigniter-reactor/

稳定:http://codeigniter.com/

这篇关于CodeIgniter 启用查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆