首页| 新闻| 娱乐| 游戏| 科普| 文学| 编程| 系统| 数据库| 建站| 学院| 产品| 网管| 维修| 办公| 热点
结合js做的,具体的话相应要做修改,比如目录制<script language="javascript">with (document) { write("<style type='text/css'>"); write(".child ") write("</style>"); }function initit(){ divcoll = document.all.tags("div"); for (i=0; i<divcoll.length; i++) { whichel = divcoll(i); if (whichel.classname == "child") whichel.style.display = "none"; }}function expandit(el) { whichel = eval(el + "child"); if (whichel.style.display == "none") { whichel.style.display = "block"; } else { whichel.style.display = "none"; } }onload = initit;</script><link href=../main.css rel=stylesheet type=text/css><?function hsort($a) { $b=''; $c=''; for($i=0;$i<count($a);$i++) { $j=substr($a[$i],0,1); if($j=='d') if($i==0) $b=$a[$i]; else $b.=' && %%'.$a[$i]; else if($i==0) $c=$a[$i]; else $c.=' && %%'.$a[$i]; } if($b=='') { $ff=explode(' && %%',$c); return $ff; } else { if($c=='') { $ff=explode(' && %%',$b); return $ff; } else { $f1=$b.' && %%'.$c; $ff=explode(' && %%',$f1); return $ff; } } }require("./class/ftp.php");$host='localhost';$user='huyang';$pass='huyang';function ftpurl($url,$konge,$in,$name) { if($konge>10) {} else { global $host,$user,$pass; $ftp=new ftp; $ftp->init($host,$user,$pass); $ftp->initpwd($url); $a=$ftp->mulu(); $ftp->close(); $a=hsort($a); if($in!=1) { $sss=$name.'child'; echo'<div id="'.$sss.'" class="child">'; } $v=0; for($i=1;$i<count($a);$i++) { $aa=explode(' ',$a[$i]); $j=substr($aa[0],0,1); if($j=='t') {} elseif($j=='d') { $c=count($aa); $c-=1; if(($aa[$c]=='.')||($aa[$c]=='..')) {} else { $v++; if($in==1) { $name1='url'.$v.'parent'; $names='url'.$v; echo'<div id="'.$name1.'" class="parent">'; echo'<a href="#" onclick="expandit('; echo"'".$names."'"; echo'); return false" ><img src="http://www.163design.net/p/b/img/plus.gif" border=0>'.$aa[$c].'</a></div> '; } else { $names=$name.'_'.$v; echo'<a href="#" onclick="expandit('; echo"'".$names."'"; echo'); return false" >'; for($hu=0;$hu<$konge;$hu++) echo'<img src="http://www.163design.net/p/b/img/spacer.gif" border=0 alt="">'; echo'<img src="http://www.163design.net/p/b/img/plus.gif" border=0>'.$aa[$c].'</a><br> '; } $url1=$url.'/'.$aa[$c];//may be need to change $konge1=$konge+1; ftpurl($url1,$konge1,0,$names); } } else { $c=count($aa); $c-=1; if($in==1) { $name='url'.$i.'parent'; $name1='url'.$i; echo'<div id="'.$name.'" class="parent">'; echo'<a href="#"><img src="http://www.163design.net/p/b/img/open.gif" border=0>'.$aa[$c].'</a></div> '; } else { echo'<a href="#">'; for($hu=0;$hu<$konge;$hu++) echo'<img src="http://www.163design.net/p/b/img/spacer.gif" border=0 alt="">'; echo'<img src="http://www.163design.net/p/b/img/open.gif" border=0>'.$aa[$c].'</a><br> '; } } } if($in!=1) echo'</div>'; } }$ftp=new ftp;$ftp->init($host,$user,$pass);$s=$ftp->pwd();$ftp->close();ftpurl($s,0,1,'url1'); //$s may be need to change?> [提示:可先修改代码再按运行]以下为类文件<?class ftp { var $id,$tid,$host,$user,$pass,$pwd; var $china_mulu; function init($host,$user,$pass) { $this->host=$host; $this->user=$user; $this->pass=$pass; $this->setup(); } function setup() { if($this->host=='')$this->host='localhost'; if($this->user=='')$this->user=''; if($this->pass=='')$this->pass=''; $this->id=ftp_connect($this->host) or $this->ftp_msg("can not connect ftp"); $this->tid=ftp_login($this->id,$this->user,$this->pass) or $this->ftp_msg("can not open it"); } function pwd()//取得路径 { $this->pwd=ftp_pwd($this->id); return $this->pwd; } function initpwd($pwd) { $this->pwd=$pwd; } function mulu()//取得目录 { if(!$this->pwd) $this->pwd=ftp_pwd($this->id); $this->chinamulu=ftp_rawlist($this->id,$this->pwd); return $this->chinamulu; } function upmulu()//返回上级目录 { $a=ftp_cdup($this->id) or $this->ftp_msg("already be the uppest!!"); } function close() { ftp_quit($this->id); } function ftp_msg($err) { print"<font color=red><h1><center>$err</center></h1></font>"; } }?> [提示:可先修改代码再按运行]
Intel工程样品CPU的识别方法
图解CMOS路线和硬盘光驱跳线的
硬盘分区如何设置准确的分区空间
回眸一笑百魅生,六宫粉黛无颜色
岁月静美,剪一影烟雨江南
芜湖有个“松鼠小镇”
小满:小得盈满,一切刚刚好!
一串串晶莹剔透的葡萄,像一颗颗宝石挂在藤
正宗老北京脆皮烤鸭
人逢知己千杯少,喝酒搞笑图集
搞笑试卷,学生恶搞答题
新闻热点
疑难解答
图片精选
扩展你的 PHP 之入门篇
特转载一高手总结PHP学习资源和链
网友关注