为什么我这样写的PHP不对呢?<?php
header("Content type: text/xml; charset=GB2312\n");
echo '<?xml version="1.0" encoding="gb2312" ?>';
?>
<tree>
<?php
require_once './global.php';
$path = $tmplRootDir.$_GET[path];
$f = @opendir($path);
while($name = @readdir($f)) {
//echo $path.'/'.$name;
if ($name=="."||$name==".." || is_file($path.'/'.$name)) continue;
else
echo <<<s
<tree text="$name" action="sysTemplateAdmin.php?path=$_GET[path]/$name" src="sysTemplateTree.php?path=$_GET[path]/$name" target="sm" cId="" />\n
s;
}
?>
</tree>
header("Content type: text/xml; charset=GB2312\n");
echo '<?xml version="1.0" encoding="gb2312" ?>';
?>
<tree>
<?php
require_once './global.php';
$path = $tmplRootDir.$_GET[path];
$f = @opendir($path);
while($name = @readdir($f)) {
//echo $path.'/'.$name;
if ($name=="."||$name==".." || is_file($path.'/'.$name)) continue;
else
echo <<<s
<tree text="$name" action="sysTemplateAdmin.php?path=$_GET[path]/$name" src="sysTemplateTree.php?path=$_GET[path]/$name" target="sm" cId="" />\n
s;
}
?>
</tree>
在xmlHTTP.open("GET","getUserList.php",false)后面加上response.write.responsetext看看有什么输出吧,
首先你直接访问你的php,看看结果对不对