有時候不要依賴不該依賴的 PHP 設定,magic_quotes_gpc=On,在程式編制的過程,儘量關閉這個配置選項,任何時候判斷這個選項後再對使用者輸入的資料進行處理。
切記——PHP 5.3 中已廢棄這一特性 5.4 中將會刪除這個選項。
可以在 php.ini 裏設定
; This directive is deprecated. Use variables_order instead.
gpc_order = “GPC”
; Magic quotes
;
; Magic quotes for incoming GET/POST/Cookie data.
;magic_quotes_gpc = Off
; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
;magic_quotes_runtime = Off
; Use Sybase-style magic quotes (escape ‘ with ” instead of ’).
;magic_quotes_sybase = Off
如果安裝了 CPanel 面板,需要在 Home ?Software ?MultiPHP INI Editor [Documentation] ?Editor mode 修改。