|   
 UID2031431 威望27 点 金钱2 金币 点卡10 点 
 | 
1#
 发表于 2005-11-6 00:15 
 | 只看该作者 
 删除文件或文件夹的程序
| 复制代码<style>input,body{font-family:verdana; font-size:12px; background-color:#fcfcfc}</style><?phpfunction CleanDir($dir) {    $handle=opendir($dir);     while ( $file=readdir($handle) )     {        if ( ($file==".") || ($file=="..") ) continue;        if ( is_dir("$dir/$file") )         {            CleanDir("$dir/$file");            if ( rmdir("$dir/$file") )    echo "Remove dir "$dir/$file" successfully!<p>"; else                echo "<FONT COLOR=RED>Fail to Remove dir "$dir/$file"!</FONT><P>";         }         else         {             if ( unlink("$dir/$file") ) echo "Del file "$dir/$file" successfully!<p>";             else         echo "<FONT COLOR=RED>Fail to del file "$dir/$file"!</FONT><P>";         }    }    closedir($handle);} if ( !IsSet($dirname) ) {    echo "<form action=$PHP_SELF method=post name=delform><center><font color=red>Folder or File</font> to be deled: <input name=dirname style="color:red"> password: <input type=password name=pass size=6> <input type=submit></center></form>";     echo " <SCRIPT> document.delform.dirname.focus() </SCRIPT> ";}else {    if ($pass!="hg")        die("wrong password");    if ( is_file( $dirname ) )    {    if ( unlink($dirname) )        echo "Del file "$dirname" successfully!<p>"; else                echo "<FONT COLOR=RED>Fail to del file "$dirname"!</FONT><P>";     }    else    {    CleanDir($dirname);    if ( rmdir($dirname) )        echo "Remove dir "$dirname" successfully!<p>";     else         echo "<FONT COLOR=RED>Fail to Remove dir "$dirname"!</FONT><P>";     }} ?>
 | 
 
| 哈哈哈!!!!你的IP是不是  ?我都知道了!!! |  |