<?php
include_once ("inc/auth.inc.php");
function tree($parentid = 0) {
/*获取递归的数据*/
$sql = "select * from file_sort where sort_parent = $parentid";
$sql1="select * from file_sort where sort_parent = $parentid order by sort_no asc";
if($parentid ==0){
$rs = mysql_query ( $sql,TD::conn() );
}else{
$rs = mysql_query ( $sql1,TD::conn() );
}
echo ("<ul>");
while ( $ra = mysql_fetch_row ( $rs ) ) { /* 循环输出是树节点 */
?>
<input type="radio" name="radio_chose" id="<?php
echo $ra [1];
?>" value="<?php
echo $ra [0];
?>" onClick="func_click(this)"/><?php
echo ('<ul>' . $ra [0] . '</ul>');
?>
<?php
/* 递归调用 -循环输出子节点*/
tree ( $ra [1] );
}
echo ("</ul>");
}
tree ();
?>