2016-04-08 48 views
2

我更新從PHP 5.6到PHP 7我升級到PHP 7和超級全局的要求是空

$_REQUEST['some_var']我這樣做會返回一個錯誤,它沒有設置...

是正常的$_REQUEST是空的?

例子:

echo $_REQUEST['login_ID'] 

回報

注意:未定義指數:LOGIN_ID在

+0

,而不是「代碼這樣的事情」,你可以發佈SSCCE展示確切的問題,有確切的錯誤mesasage。 http://sscce.org/ –

+0

我使用常規示例編輯帖子 –

回答

4

檢查php.ini文件request_order。可能它沒有正確設置。

http://php.net/manual/en/ini.core.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" 
+0

嗨,在我的情況下,我需要request_order =「GPC」(C代表Cookie)謝謝;) –