如果大家使用PHP4.2版本或者以上的請看這裡。 設置register_globals = on 或者 加入以下代碼: // allow script to work with registerglobals off if ( function_exists(ini_get) ) { $onoff = ini_get(register_globals); } else { $onoff = get_cfg_var(register_globals); } if ($onoff != 1) { @extract($HTTP_SERVER_VARS, EXTR_SKIP); @extract($HTTP_COOKIE_VARS, EXTR_SKIP); @extract($HTTP_POST_FILES, EXTR_SKIP); @extract($HTTP_POST_VARS, EXTR_SKIP); @extract($HTTP_GET_VARS, EXTR_SKIP); @extract($HTTP_ENV_VARS, EXTR_SKIP); } 詳細參考這裡: http://www.21php.com/tutorial/tutorial.php?tid=21 相關討論請看這裡: http://www.21php.com/forums/showthread.php?s=&postid=588#post588 http://www.21php.com/forums/showthread.php?s=&postid=400#post400