register_globals=Off的情况不仅仅影响到如何获取从<form>、url传递过来的数据,也影响到session、cookie,对应的,得到session、cookie的方式应该为:$_SESSION[]、$_COOKIE。同时对于session的处理也有一些改变,比如,session_register()没有必要而且失效,具体的变化,请查看php manual里的Session handlingfunctions $_REQUEST中间的内容实际上还是来源于$_GET $_POST $_COOKIE,缺点是无法判断变量到底来自于get post 还是cookie,对要求比较严格的场合不适用。
php manual 写到:
Variables provided to the script via the GET,POST, and COOKIE input mechanisms, and which therefore cannot betrusted. The presence and order of variable inclusion in this array isdefined according to the PHP variables_order configuration directive.