编写了一个新闻发布系统,用到了下面的语句:
53:reset ($HTTP_GET_VARS);
54: while (list ($key, $val) = each ($HTTP_GET_VARS)) {
55: $nextItem = "&".strtolower($key)."=";
if (!stristr($MM_removeList, $nextItem)) {
$MM_keepURL .= "&".$key."=".urlencode($val);
}
}
结果运行时候,出现这样的错误:
Warning: reset() expects parameter 1 to be array, null given in C:\Inetpub\wwwroot\test2\admin.php on line 52Warning: Variable passed to each() is not an array or object in C:\Inetpub\wwwroot\test2\admin.php on line 53根据参考手册,却不知道($HTTP_GET_VARS)数组应该定义为怎样的形式。请求帮忙啊!
53:reset ($HTTP_GET_VARS);
54: while (list ($key, $val) = each ($HTTP_GET_VARS)) {
55: $nextItem = "&".strtolower($key)."=";
if (!stristr($MM_removeList, $nextItem)) {
$MM_keepURL .= "&".$key."=".urlencode($val);
}
}
结果运行时候,出现这样的错误:
Warning: reset() expects parameter 1 to be array, null given in C:\Inetpub\wwwroot\test2\admin.php on line 52Warning: Variable passed to each() is not an array or object in C:\Inetpub\wwwroot\test2\admin.php on line 53根据参考手册,却不知道($HTTP_GET_VARS)数组应该定义为怎样的形式。请求帮忙啊!
你把设置元素的代码的贴出来!
$HTTP_GET_VARS是以前才用的。
if (!isset($_SERVER))
{
$_GET = &$HTTP_GET_VARS;
$_POST = &$HTTP_POST_VARS;
$_ENV = &$HTTP_ENV_VARS;
$_SERVER = &$HTTP_SERVER_VARS;
$_COOKIE = &$HTTP_COOKIE_VARS;
$_REQUEST = array_merge($_GET, $_POST, $_COOKIE);
}
现在用$_GET