php的树结构怎么实现。。。。高分奉送。。。。。 我很急的。有人回复吗。。我有1000分奉送的快来呀。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不是和一般用数据库的外键联系的方法一样么 利用脚本语言,很方便,不过需要在数据库中建两个数据表 <SCRIPT lanuage="Javascript">var tt='start';var ii='start';function turnit(ss,bb) { if (ss.style.display=="none") { if(tt!='start') tt.style.display="none"; if(ii!='start') ii.src="../img/line_01.gif"; ss.style.display=""; tt=ss; ii=bb; bb.src="../img/line_01_2.gif"; } else { ss.style.display="none"; bb.src="../img/line_01.gif"; }}var tt2='startx';var ii2='startx';function turnit2(ss2,bb2) { if (ss2.style.display=="none") { if(tt2!='startx') tt2.style.display="none"; if(ii2!='startx') ii2.src="../img/smalluser.gif"; ss2.style.display=""; tt2=ss2; ii2=bb2; bb2.src="../img/smalluser.gif"; } else { ss2.style.display="none"; bb2.src="../img/smalluser.gif"; }}var tt3='startxs';var ii3='startxs';function turnit3(ss3,bb3) { if (ss3.style.display=="none") { if(tt3!='startxs') tt3.style.display="none"; if(ii3!='startxs') ii3.src="../img/smallhead.gif"; ss3.style.display=""; tt3=ss3; ii3=bb3; bb3.src="../img/smallhead.gif"; } else { ss3.style.display="none"; bb3.src="../img/smallhead.gif"; }}function openWindow(url) { popupWin = window.open(url, 'new_page', 'width=400,height=410,scrollbars')}</SCRIPT>PHP部分 <?php// ------------------------- -------- ------------------------- //$cr=mysql_query("select toptype_id ,news_type from news_toptype");$cn=mysql_num_rows($cr);for($i=0;$i<$cn;$i++) { //$classid=mysql_result($cr,$i,"news_type"); $class=mysql_result($cr,$i,"news_type"); $fr=mysql_query("select * from news_type where topid='$class'")or die(mysql_error()); $fn=mysql_num_rows($fr); echo " <TR bgcolor='#ffffff' 'aaeedd'><TD language=JScript onclick=turnit(Content$i,tag$i); style='CURSOR: hand' vAlign=center><IMG id=tag$i src='../img/line_01.gif'> $class</TD></TR> <TR> <TD id=Content$i style='DISPLAY: none' vAlign=center> <TABLE border=0 cellPadding=0 cellSpacing=1 width='100%'>"; for($j=0;$j<$fn;$j++) { $db=mysql_result($fr, $j, "type_id"); $forumtitle[$db]=mysql_result($fr, $j, "news_type"); $forumtitle[news_type]=mysql_result($fr,$j,"news_type"); //$privateforum[$db]=mysql_result($fr, $j, "privateforum"); echo "<TR><TD><IMG src='../img/line_05.gif'><IMG src='../img/dot_01.gif'><a href='list.php?list_type=$forumtitle[news_type]' target='mainFrame'>$forumtitle[$db]</A></TD></TR>"; } echo "</TABLE></TD></TR>";}?> 还有回复的吗。谢谢大家高分奉送。。 php语法 __autoload的引用问题。 实例化的类必须和文件名的前缀必须相同? 各位大侠帮我看看我代码的错误 mysql索引用不到的问题 图片批量上传 php soapclient问题请教 又是session,在线等!急!!! 请问这个highlight_string()函数怎样使用。请指教。 怎样理解面向对象编程? THINKPHP求助删除原来短信验证码 怎么比较日期啊? php的树结构怎么实现。。。。高分奉送。。。。。
var tt='start';
var ii='start';
function turnit(ss,bb) { if (ss.style.display=="none") {
if(tt!='start') tt.style.display="none";
if(ii!='start') ii.src="../img/line_01.gif";
ss.style.display="";
tt=ss;
ii=bb;
bb.src="../img/line_01_2.gif";
}
else {
ss.style.display="none";
bb.src="../img/line_01.gif";
}
}
var tt2='startx';
var ii2='startx';
function turnit2(ss2,bb2) { if (ss2.style.display=="none") {
if(tt2!='startx') tt2.style.display="none";
if(ii2!='startx') ii2.src="../img/smalluser.gif";
ss2.style.display="";
tt2=ss2;
ii2=bb2;
bb2.src="../img/smalluser.gif";
}
else {
ss2.style.display="none";
bb2.src="../img/smalluser.gif";
}
}
var tt3='startxs';
var ii3='startxs';
function turnit3(ss3,bb3) { if (ss3.style.display=="none") {
if(tt3!='startxs') tt3.style.display="none";
if(ii3!='startxs') ii3.src="../img/smallhead.gif";
ss3.style.display="";
tt3=ss3;
ii3=bb3;
bb3.src="../img/smallhead.gif";
}
else {
ss3.style.display="none";
bb3.src="../img/smallhead.gif";
}
}
function openWindow(url) {
popupWin = window.open(url, 'new_page', 'width=400,height=410,scrollbars')
}
</SCRIPT>
PHP部分
<?php// ------------------------- -------- ------------------------- //
$cr=mysql_query("select toptype_id ,news_type from news_toptype");
$cn=mysql_num_rows($cr);
for($i=0;$i<$cn;$i++) {
//$classid=mysql_result($cr,$i,"news_type");
$class=mysql_result($cr,$i,"news_type");
$fr=mysql_query("select * from news_type where topid='$class'")or die(mysql_error());
$fn=mysql_num_rows($fr);
echo "
<TR bgcolor='#ffffff' 'aaeedd'>
<TD language=JScript onclick=turnit(Content$i,tag$i);
style='CURSOR: hand' vAlign=center><IMG id=tag$i
src='../img/line_01.gif'>
$class</TD></TR>
<TR>
<TD id=Content$i style='DISPLAY: none' vAlign=center>
<TABLE border=0 cellPadding=0 cellSpacing=1 width='100%'>"; for($j=0;$j<$fn;$j++) {
$db=mysql_result($fr, $j, "type_id");
$forumtitle[$db]=mysql_result($fr, $j, "news_type");
$forumtitle[news_type]=mysql_result($fr,$j,"news_type");
//$privateforum[$db]=mysql_result($fr, $j, "privateforum");
echo "<TR><TD><IMG src='../img/line_05.gif'><IMG src='../img/dot_01.gif'><a href='list.php?list_type=$forumtitle[news_type]' target='mainFrame'>$forumtitle[$db]</A></TD></TR>"; }
echo "</TABLE></TD></TR>";
}
?>