<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>测试</title>
</head>
<body>
<script>
function hideAll() {
  for(i=0;i<odiv.length;i++) {
    odiv[i].style.display="none";
  }
}function showObj(num) {
  if (odiv[num].style.display=="none") {
    hideAll();
    odiv[num].style.display="inline";
  }
  else {
    odiv[num].style.display="none";
  }
}
</script>
<table width="75%" border="1">
  <tr>
    <td width="50%">
<table width="200" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width=160 height=21 class="textlinkbgyellow" onclick="showObj(0)"> 
            交通运输</td>
        </tr>
        <tr> 
          <td id="odiv" style="display:none" div><span class="texttitle"><a href=?sel=1>全部交通运输</A><br>
            <a href=?sel=2>铁路运输设备/配件/保养品</a></span><span class="number"><br>
            </span></td>
        </tr>
        <tr> 
          <td width=160 height=21 class="textlinkbgyellow" onclick="showObj(1)"> 
            电脑网络计算机</td>
        </tr>
        <tr> 
          <td div id="odiv" style="display:none"><span class="texttitle"><A href=?sel=3>配件</A><br>
            <A href=?sel=4>整机</A></span><br></td>
        </tr>
      </table>
    </td>
    <td align="center">
<table width="90%" height="150" cellpadding="0" cellspacing="0">
        <TR>
        <? 
            if(!isset($sel)) $sel=1;
            if($sel==0) $sel=1;
            switch($sel)
            {
                case '1':
                    echo"<td>全部交通运输</td>";
                    break;
                case '2':
                    echo"<td>铁路运输设备</td>";
                    break;
                case '3':
                    echo"<td>配件</td>";
                    break;
                case '4':
                    echo"<td>整机</td>";
                    break;
            }
        ?>    
        </TR></table>
    </td>
  </tr>
</table>
</body>
</html>

解决方案 »

  1.   

    to:多菜鸟
    就改成<a href=?sel=1>这样吗?但还是有错误啊!提示如下:
    CGI Error
    The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
      

  2.   

    <a href="文件名?sel=1">
    我这里测试没有问题的。
    要不你干脆就把文件名跟上,你这样子的错误好像不是代码问题,是不是你的PHP还没有装好?
      

  3.   

    CGI Error是指那方面出错了啊?
      

  4.   

    我用的是IIS服务器,是不是要改成APACHE更好?