js部分
<php>//这里的category_cid=0是一级目录
$sql2="select category_id,category_name from category where category_cid='0' order by category_rank";
$result2=@mysql_query($sql2);
$iii=0;
while(($row2 = mysql_fetch_array($result2))) {
$iii++;
}
</php>
<script language=javascript id=clientEventHandlersJS>
<!--
var number=<php>echo $iii;</php>;
function LMYC() {
var lbmc;
//var treePic;
for (i=1;i<=number;i++) {
lbmc = eval('LM' + i);
//treePic = eval('treePic'+i);
//treePic.src = 'tupian/images/file.gif';
lbmc.style.display = 'none';
}
}
function ShowFLT(i) {
lbmc = eval('LM' + i);
//treePic = eval('treePic' + i)
if (lbmc.style.display == 'none') {
LMYC();
//treePic.src = 'tupian/images/nofile.gif';
lbmc.style.display = '';
}
else {
//treePic.src = 'tupian/images/file.gif';
lbmc.style.display = 'none';
}
}
//-->
</script>
body部分
<table width="222" height="250" border="0" cellpadding="0" cellspacing="0">
<tbody>
<!--中间部列表开始-->
<tr>
<td valign="top" background="">
<!--中间表格开始-->
<TABLE cellSpacing=0 cellPadding=0 width="88%" border=0>
<TBODY>
<php>
<php>
$sql="select category_id,category_name from category where category_cid='0' order by category_rank";
$result=@mysql_query($sql);
$ii=0;
while(($row = mysql_fetch_array($result))) {
$ii++;
</php>
<TR>
<TD style="PADDING-LEFT: 20px" background="" height=30><IMG
height=13 src="__PUBLIC__/img/changping_09.jpg" width=13
align=absMiddle> <A οnclick=javascript:ShowFLT("<php>echo $ii;</php>")
href="javascript:void(null)" class="aa"><php>echo $row['1'];</php></A> </TD>
</TR>
<TR id= "<php>echo "LM".$ii;</php>" style="DISPLAY: none">
<TD><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<php>
//在这儿category_cid只能等于与他对应的大类
$sql1="select category_id,category_name from category where category_cid=".$row[0]." order by category_rank";
$result1=mysql_query($sql1);
while(($row1 = mysql_fetch_array($result1))) {
</php>
<TR>
<TD style="PADDING-LEFT: 40px" height=23><!--<IMG height=7
src=" " width=8 align=absMiddle> --><A title=文件夹
href="__URL__/Product?cateid=<php>echo $row1['0'];</php>"
target=_parent><php>echo $row1['1'];</php></A> </TD>
</TR>
<TR>
<TD background="" height=3></TD>
</TR>
<php>
}
</php>
</TBODY>
</TABLE></TD>
</TR>
<php>
}
</php>
</TBODY>
</TABLE><!--中间表格结束--></td>
</tr><!--中间列表结束-->
</tbody>
</table>