PHP鍙橀噺涓殑棰勫畾涔夊彉閲忎粙缁

PHP 鎻愪緵浜嗗ぇ閲忕殑棰勫畾涔夊彉閲忋傜敱浜庤澶氬彉閲忎緷璧栦簬杩愯鐨勬湇鍔″櫒鐨勭増鏈拰璁剧疆锛屽強鍏跺畠鍥犵礌锛屾墍浠ュ苟娌℃湁璇︾粏鐨勮鏄庢枃妗c備竴浜涢瀹氫箟鍙橀噺鍦 PHP 浠ュ懡浠よ褰㈠紡杩愯鏃跺苟涓嶇敓鏁堛傛湁鍏宠繖浜涘彉閲忕殑璇︾粏鍒楄〃锛岃鍙傞槄棰勫畾涔夊彉閲忎竴绔犮

Warning
PHP 4.2.0 浠ュ強鍚庣画鐗堟湰涓紝PHP 鎸囦护 register_globals 鐨勯粯璁ゅ间负 off銆傝繖鏄 PHP 鐨勪竴涓富瑕佸彉鍖栥傝 register_globals 鐨勫间负 off 灏嗗奖鍝嶅埌棰勫畾涔夊彉閲忛泦鍦ㄥ叏灞鑼冨洿鍐呯殑鏈夋晥鎬с備緥濡傦紝涓轰簡寰楀埌 DOCUMENT_ROOT 鐨勫硷紝灏嗗繀椤讳娇鐢 $_SERVER['DOCUMENT_ROOT'] 浠f浛 $DOCUMENT_ROOT锛屽張濡傦紝浣跨敤 $_GET['id'] 鏉ヤ唬鏇 $id 浠 URL http://www.example.com/test.php?id=3 涓幏鍙 id 鍊硷紝浜︽垨浣跨敤 $_ENV['HOME'] 鏉ヤ唬鏇 $HOME 鑾峰彇鐜鍙橀噺 HOME 鐨勫笺

鏇村鐩稿叧淇℃伅锛岃闃呰 register_globals 鐨勯厤缃」鏉$洰锛屽畨鍏ㄤ竴绔犱腑鐨勪娇鐢 Register Globals锛屼互鍙 PHP ? 4.1.0 鍜 ? 4.2.0 鐨勫彂甯冨叕鍛娿

濡傛灉鏈夊彲鐢ㄧ殑 PHP 棰勫畾涔夊彉閲忛偅鏈濂界敤锛屽瓒呭叏灞鏁扮粍銆

浠 PHP 4.1.0 寮濮嬶紝PHP 鎻愪緵浜嗕竴濂楅檮鍔犵殑棰勫畾鏁扮粍锛岃繖浜涙暟缁勫彉閲忓寘鍚簡鏉ヨ嚜 web 鏈嶅姟鍣紙濡傛灉鍙敤锛夛紝杩愯鐜锛屽拰鐢ㄦ埛杈撳叆鐨勬暟鎹傝繖浜涙暟缁勯潪甯哥壒鍒紝瀹冧滑鍦ㄥ叏灞鑼冨洿鍐呰嚜鍔ㄧ敓鏁堬紝渚嬪锛屽湪浠讳綍鑼冨洿鍐呰嚜鍔ㄧ敓鏁堛傚洜姝ら氬父琚О涓鸿嚜鍔ㄥ叏灞鍙橀噺锛坅utoglobals锛夋垨鑰呰秴鍏ㄥ眬鍙橀噺锛坰uperglobals锛夈傦紙PHP 涓病鏈夌敤鎴疯嚜瀹氫箟瓒呭叏灞鍙橀噺鐨勬満鍒躲傦級瓒呭叏灞鍙橀噺缃楀垪浜庝笅鏂囦腑锛涗絾鏄负浜嗗緱鍒板畠浠殑鍐呭鍜屽叧浜 PHP 棰勫畾涔夊彉閲忕殑杩涗竴姝ョ殑璁ㄨ浠ュ強瀹冧滑鐨勬湰璐紝璇峰弬闃呴瀹氫箟鍙橀噺銆傝屼笖锛屼綘涔熷皢娉ㄦ剰鍒版棫鐨勯瀹氫箟鏁扮粍锛$HTTP_*_VARS锛変粛鏃у瓨鍦ㄣ傝嚜 PHP 5.0.0 璧, 鐢 register_long_arrays 璁剧疆閫夐」鍙鐢 闀跨被鍨嬬殑 PHP 棰勫畾涔夊彉閲忔暟缁勩

Note: 鍙彉鍙橀噺
瓒呯骇鍏ㄥ眬鍙橀噺涓嶈兘琚敤浣滃彲鍙樺彉閲忋

Note:

灏界瓒呭叏灞鍙橀噺鍜 HTTP_*_VARS 鍚屾椂瀛樺湪銆備絾鏄粬浠苟涓嶆槸鍚屼竴涓彉閲忥紝鎵浠ユ敼鍙樹竴涓殑鍊煎苟涓嶄細瀵瑰彟涓涓骇鐢熷奖鍝嶃

濡傛灉鏌愪簺 variables_order 涓殑鍙橀噺娌℃湁璁惧畾锛屽畠浠殑瀵瑰簲鐨 PHP 棰勫畾涔夋暟缁勪篃鏄┖鐨勩

浠ヤ笂灏辨槸PHP鍙橀噺涓殑棰勫畾涔夊彉閲忎粙缁嶇殑璇︾粏鍐呭锛屾洿澶氫俊鎭鍏虫敞OD浜戝叾瀹冪浉鍏虫枃绔狅紒



鏈枃URL锛http://www.odweb.cn/news_show.html?id=57