您现在的位置:情感咨询 > 情感口述 > 正文

一个FTP树状目录(PHP)-PHP代码-PHP教程-幽默笑话

一个FTP树状目录(PHP)-PHP代码-PHP教程-幽默笑话

文章内容一个FTP树状目录(PHP)修改时间:[2012/05/0320:28]阅读次数:[942]发表者:[起缘]结合js做的,具体的话相应要做修改,比如目录制[HTML]scriptlanguage="JavaScript"with(document){write("STYLETYPE=text/csswrite(".child")write("/STYLE}functioninitIt(){divColl=("DIV");for(i=0;;i++){whichEl=divColl(i);if(=="child")="none";}}functionexpandIt(el){whichEl=eval(el+"Child");if(=="none"){="block";}else{="none";}}onload=initIt;/scriptLINKhref=../=stylesheettype=text/cssfunctionhsort($a){$b=;$c=;for($i=0;$icount($a);$i++){$j=substr($a[$i],0,1);if($j==d)if($i==0)$b=$a[$i];else$b.=%%.$a[$i];elseif($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/");$HOST=localhost;$USER=huyang;$PASS=huyang;functionftpurl($url,$konge,$in,$name){if($konge10){}else{global$HOST,$USER,$PASS;$ftp=newftp;$ftp-init($HOST,$USER,$PASS);$ftp-initpwd($url);$a=$ftp-mulu();$ftp-close();$a=hsort($a);if($in!=1){$sss=$name.Child;echodivid=".$sss."class="child"}$v=0;for($i=1;$icount($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;echodivid=".$name1."class="parent"echoahref="#"onClick="expandIt(;echo"".$names."";echo);returnfalse"imgsrc="img/"border=0.$aa[$c]./a/div;}else{$names=$name._.$v;echoahref="#"onClick="expandIt(;echo"".$names."";echo);returnfalse"for($hu=0;$hu$konge;$hu++)echoimgsrc="img/"border=0alt=""echoimgsrc="img/"border=0.$aa[$c]./abr;}$url1=$url./.$aa[$c];//maybeneedtochange$konge1=$konge+1;ftpurl($url1,$konge1,0,$names);}}else{$c=count($aa);$c-=1;if($in==1){$name=URL.$i.Parent;$name1=URL.$i;echodivid=".$name."class="parent"echoahref="#"imgsrc="img/"border=0.$aa[$c]./a/div;}else{echoahref="#"for($hu=0;$hu$konge;$hu++)echoimgsrc="img/"border=0alt=""echoimgsrc="img/"border=0.$aa[$c]./abr;}}}if($in!=1)echo/div}}$ftp=newftp;$ftp-init($HOST,$USER,$PASS);$s=$ftp-pwd();$ftp-close();ftpurl($s,0,1,URL1);//$smaybeneedtochange[/HTML]以下为类文件[HTML]classftp{var$id,$tid,$HOST,$USER,$PASS,$pwd;var$china_mulu;functioninit($HOST,$USER,$PASS){$this-HOST=$HOST;$this-USER=$USER;$this-PASS=$PASS;$this-setup();}functionsetup(){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("cannotconnectftp");$this-tid=ftp_login($this-id,$this-USER,$this-PASS)or$this-ftp_msg("cannotopenit");}functionpwd()//取得路径{$this-pwd=ftp_pwd($this-id);return$this-pwd;}functioninitpwd($pwd){$this-pwd=$pwd;}functionmulu()//取得目录{if(!$this-pwd)$this-pwd=ftp_pwd($this-id);$this-chinamulu=ftp_rawlist($this-id,$this-pwd);return$this-chinamulu;}functionupmulu()//返回上级目录{$a=ftp_cdup($this-id)or$this-ftp_msg("alreadybetheuppest!!");}functionclose(){ftp_quit($this-id);}functionftp_msg($err){print"fontcolor=redh1center$err/center/h1/font}}[/HTML]。

上一篇:白话财经:政府鼓励的3P是个啥(组图)
下一篇:没有了
回到顶部