您好,欢迎访问一九零五行业门户网

$_REQUEST为什么是空的?

我的 php.ini 是这样设置的:
variables_order = egpcs
request_order =
request_order 留空的话不是会使用 variables_order 的值吗?
回复讨论(解决方案) 不知道你怎么请求的,把你的请求过程描述一下。
 request_order =gp
不是默认的get和post,设置为空干嘛?
不知道你怎么请求的,把你的请求过程描述一下。
xxx.php?aaa=bbb
request_order 为空的时候 $_request 是空数组,
request_order = gp 的时候 $_request 才有内容。
不知道你怎么请求的,把你的请求过程描述一下。
xxx.php?aaa=bbb
request_order 为空的时候 $_request 是空数组,
request_order = gp 的时候 $_request 才有内容。
这就对了,看request_order 的解释,它设置的是$_request变量的设置和覆盖顺序。如果为空,也就是$_request不包含p(post),g(get)和c(cookie)变量了,自然就是空了
不知道你怎么请求的,把你的请求过程描述一下。
xxx.php?aaa=bbb
request_order 为空的时候 $_request 是空数组,
request_order = gp 的时候 $_request 才有内容。
这就对了,看request_order 的解释,它设置的是$_request变量的设置和覆盖顺序。如果为空,也就是$_request不包含p(post),g(get)和c(cookie)变量了,自然就是空了
那 php 的下面这句话是什么意思:
if this directive is not set, variables_order is used for $_request contents.


不是说留空就会使用 variables_order 的值吗?
还有 php.ini 里面说的 :
626 ; this directive determines which super global data (g,p,c,e & s) should 627 ; be registered into the super global array request. if so, it also determines 628 ; the order in which that data is registered. the values for this directive are 629 ; specified in the same manner as the variables_order directive, except one. 630 ; leaving this value empty will cause php to use the value set in the 631 ; variables_order directive. it does not mean it will leave the super globals 632 ; array request empty. 633 ; default value: none 634 ; development value: gp 635 ; production value: gp 636 ; http://php.net/request-order 637 request_order = gp


难道我理解错了吗?我的英文水平是比较差。。。
不知道你怎么请求的,把你的请求过程描述一下。
xxx.php?aaa=bbb
request_order 为空的时候 $_request 是空数组,
request_order = gp 的时候 $_request 才有内容。
这就对了,看request_order 的解释,它设置的是$_request变量的设置和覆盖顺序。如果为空,也就是$_request不包含p(post),g(get)和c(cookie)变量了,自然就是空了
那 php 的下面这句话是什么意思:
if this directive is not set, variables_order is used for $_request contents.


不是说留空就会使用 variables_order 的值吗?
还有 php.ini 里面说的 :
626 ; this directive determines which super global data (g,p,c,e & s) should 627 ; be registered into the super global array request. if so, it also determines 628 ; the order in which that data is registered. the values for this directive are 629 ; specified in the same manner as the variables_order directive, except one. 630 ; leaving this value empty will cause php to use the value set in the 631 ; variables_order directive. it does not mean it will leave the super globals 632 ; array request empty. 633 ; default value: none 634 ; development value: gp 635 ; production value: gp 636 ; http://php.net/request-order 637 request_order = gp


难道我理解错了吗?我的英文水平是比较差。。。
刚测试了。variables_order = gp
或者variables_order = gpcs
request_order =
的情况下确实如手册所说,request_order的值会使用variables_order的值。
php 5.2.17.
比较纳闷的是,记得changelog中request_order是在5.3中引入的,不知为何5.2的配置中也有该配置项
不知道你怎么请求的,把你的请求过程描述一下。
xxx.php?aaa=bbb
request_order 为空的时候 $_request 是空数组,
request_order = gp 的时候 $_request 才有内容。
这就对了,看request_order 的解释,它设置的是$_request变量的设置和覆盖顺序。如果为空,也就是$_request不包含p(post),g(get)和c(cookie)变量了,自然就是空了
那 php 的下面这句话是什么意思:
if this directive is not set, variables_order is used for $_request contents.


不是说留空就会使用 variables_order 的值吗?
还有 php.ini 里面说的 :
626 ; this directive determines which super global data (g,p,c,e & s) should 627 ; be registered into the super global array request. if so, it also determines 628 ; the order in which that data is registered. the values for this directive are 629 ; specified in the same manner as the variables_order directive, except one. 630 ; leaving this value empty will cause php to use the value set in the 631 ; variables_order directive. it does not mean it will leave the super globals 632 ; array request empty. 633 ; default value: none 634 ; development value: gp 635 ; production value: gp 636 ; http://php.net/request-order 637 request_order = gp


难道我理解错了吗?我的英文水平是比较差。。。
刚测试了。variables_order = gp
或者variables_order = gpcs
request_order = 
的情况下确实如手册所说,request_order的值会使用variables_order的值。
php 5.2.17.
比较纳闷的是,记得changelog中request_order是在5.3中引入的,不知为何5.2的配置中也有该配置项
但是我用外国的服务器 php 5.3.24 和本地的 php 5.4.4 测试的结果都是 request_order 留空并不会使用 variables_order 的值,而是直接把 $_request 留空了。
request_order 的确是 5.3 才引进的,会不会是你设置的 request_order 压根没起作用?5.3之前可能 $_request 直接就使用的 variables_order。
对于 $_request 的处理,php5.3 的早期版本是有问题的
至少在 php 5.3.6 中,如果没有传入数据,则 $_request 是未定义的,而不是仅仅为空
不太清楚这个问题是在哪个版本中被纠正的
it does not mean it will leave the super globals array request empty.
对于 $_request 的处理,php5.3 的早期版本是有问题的
至少在 php 5.3.6 中,如果没有传入数据,则 $_request 是未定义的,而不是仅仅为空
不太清楚这个问题是在哪个版本中被纠正的
it does not mean it will leave the super globals array request empty.
我测试的两个版本是空数组,不是未定义,
刚刚看了 changelog 也没有提到这个,照这么说php文档和php.ini上面说的都是有错误的咯?
其它类似信息

推荐信息