php 为什么 $_REQUEST 是空的

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5701588/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 22:16:33  来源:igfitidea点击:

why is $_REQUEST empty

phparraysrequest

提问by Hawkseye

I have Ubuntu 10.10 with apache2, php 5.3.3-1 and mysql 5.1.

我有带有 apache2、php 5.3.3-1 和 mysql 5.1 的 Ubuntu 10.10。

I am passing some values to a page via URL. On that page, if I do print_r($_GET), then I see the array contents. But if I do print_r($_REQUEST)the array is empty. Any ideas why this could be?

我通过 URL 将一些值传递给页面。在那个页面上,如果我这样做了print_r($_GET),那么我会看到数组内容。但是如果我这样做print_r($_REQUEST)数组是空的。任何想法为什么会这样?

采纳答案by PaulP

Also try check "request_order"option in php.ini:

还可以尝试检查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"

回答by user3231437

if your post body larger than post_max_size or upload_max_filesize which in the php.ini may be cause $_POST and $_REQUEST empty too.

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