为什么$ _REQUEST为空

时间:2011-04-18 10:32:12

标签: php arrays request

我有Ubuntu 10.10 with apache2,php 5.3.3-1和mysql 5.1。

我将一些值传递给url中的页面。在那个页面上,如果我执行print_r($ _ GET),我会看到数组内容,但如果我执行print_r($ _ REQUEST),则数组为空。这可能是什么想法?

感谢。

2 个答案:

答案 0 :(得分:11)

另请尝试检查php.ini中的"request_order"选项:

; This directive determines which super global data (G,P,C,E & S) should
; be registered into the super global array REQUEST. If so, it also determines
; the order in which that data is registered. The values for this directive are
; specified in the same manner as the variables_order directive, EXCEPT one.
; Leaving this value empty will cause PHP to use the value set in the
; variables_order directive. It does not mean it will leave the super globals
; array REQUEST empty.
; Default Value: None
; Development Value: "GP"
; Production Value: "GP"
; http://php.net/request-order
request_order = "GP"

答案 1 :(得分:2)

如果您的帖子正文大于post_max_size或者upload_max_filesize,那么php.ini中的帖子可能会导致$ _POST和$ _REQUEST也为空。