zoukankan      html  css  js  c++  java
  • php 目录浏览

    <!DOCTYPE html>
    <html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>我们的服务-软件下载</title>
    <meta name="keywords" content="销售电脑,电脑维修服务,智能家居,物联网方案,智能无线,弱点施工">
    <meta name="description" content="我们的服提供临江花园-碧水豪园-西环路-联庄一区电脑维修,弱点工程施工,智能家居-物联网方案,">
    <meta name="author" content="杭州钢锅">
    <meta name="robots" content="index, follow" />
    <meta name="googlebot" content="index, follow" />
    <meta property="qc:admins" content="22007606776754676375" />
    <style>
    table{
        border-collapse:collapse;
      }
    table,td{
    border:2px solid #a8a8de;
      padding:5px 20px;
      }
    img{
        width: 20px;
        height: 20px;
    }
    th{
      border:2px solid #8282db;
      font-size:1.1em;
      text-align:center;
      padding:5px 20px;
    
      background-color:#4C9ED9;
      color:#ffffff;
      }
    a{
      text-transform:none;
      text-decoration:none;
      margin: 5px;
     }
    h2,h5{
        display : inline
    }
    </style>
    </head>
    <?php
    switch ($_SERVER["HTTP_HOST"]){ 
    case "115.236.183.115:81": 
    header("location:http://down.zhouein.com:81");
    break; 
    case "218.108.32.234": 
    header("location:http://down2.zhouein.com/");
    break;
    case "218.108.32.234:81": 
    header("location:http://down2.zhouein.com:81");
    break;
    }
      $dir = dirname(__FILE__);
      $open_dir = opendir($dir);
    
      echo "<center>";
      /* echo basename(dirname(__FILE__)); */
      echo "<h2>常用软件下载</h2><h5>for Windows</h5>
    
    ";
      echo "<table>
    ";
      echo "<tr><th>文件名</th><th>大小</th><th>添加日期</th></tr>
    
    ";
        while ($file = readdir($open_dir)){
            if ($file!= "." && $file != ".."){
               if (pathinfo($file,PATHINFO_EXTENSION)=="zip"){
                 echo "<tr>
        <td align='left'>
            <img src='/image/winrar.png' title='WindownsZip压缩包'>
            <a href='down.php?down_id=" . $file . "' target='_blank' title='点击下载'>" . $file . "</a>
            </td>
    ";
                 if (filesize($file) < 1024){
                    echo "    <td align='right'>" .  round(filesize($file),2) . " Byte</td>
    ";
                    }
                 elseif (filesize($file) < 1024*1024){
                    echo "    <td align='right'>" .  round(filesize($file)/1024,2) . " KB</td>
    ";
                    }
                 elseif (filesize($file) < 1024*1024*1024){
                    echo "    <td align='right'>" .  round(filesize($file)/(1024*1024),2) . " MB</td>
    ";
                    }
                    echo "    <td>" . date('Y-m-d H:i:s', filemtime($file)) . "</td>
        </tr>
    ";
                    /* echo "<td>" . pathinfo($file,PATHINFO_EXTENSION) . "</td></tr>"; */
                }
               if (pathinfo($file,PATHINFO_EXTENSION)=="iso"){
                 echo "<tr>
        <td align='left'>
            <img src='/image/winrar.png' title='WindownsZip压缩包'>
            <a href='down.php?down_id=" . $file . "' target='_blank' title='点击下载'>" . $file . "</a>
            </td>
    ";
                 if (filesize($file) < 1024){
                    echo "    <td align='right'>" .  round(filesize($file),2) . " Byte</td>
    ";
                    }
                 elseif (filesize($file) < 1024*1024){
                    echo "    <td align='right'>" .  round(filesize($file)/1024,2) . " KB</td>
    ";
                    }
                 elseif (filesize($file) < 1024*1024*1024){
                    echo "    <td align='right'>" .  round(filesize($file)/(1024*1024),2) . " MB</td>
    ";
                    }
                    echo "    <td>" . date('Y-m-d H:i:s', filemtime($file)) . "</td>
        </tr>
    ";
                    /* echo "<td>" . pathinfo($file,PATHINFO_EXTENSION) . "</td></tr>"; */
                }
               if (pathinfo($file,PATHINFO_EXTENSION)=="exe"){
                 echo "<tr>
        <td align='left'>
            <img src='/image/winexe.png' title='Windows可执行程序'>
            <a href='down.php?down_id=" . $file . "' target='_blank' title='点击下载'>" . $file . "</a>
            </td>
    ";
                 if (filesize($file) < 1024){
                    echo "    <td align='right'>" .  round(filesize($file),2) . " Byte</td>
    ";
                    }
                 elseif (filesize($file) < 1024*1024){
                    echo "    <td align='right'>" .  round(filesize($file)/1024,2) . " KB</td>
    ";
                    }
                 elseif (filesize($file) < 1024*1024*1024){
                    echo "    <td align='right'>" .  round(filesize($file)/(1024*1024),2) . " MB</td>
    ";
                    }
                    echo "    <td>" . date('Y-m-d H:i:s', filemtime($file)) . "</td>
        </tr>
    ";
                    /* echo "<td>" . pathinfo($file,PATHINFO_EXTENSION) . "</td></tr>"; */
                } 
            }
        }
      echo "</table>
    ";
    $countfile = "tongji.txt";  
    if(($fp=fopen("tongji.txt","r+"))==false)  
    {  
        echo "打开文件失败!";  
    }  
    else  
    {  
        $counter = fgets($fp,1024);  
        if(empty($_SESSION['temp']))  
        {  
            $counter++;  
            if(($fp=fopen("tongji.txt","w"))==false)  
                echo "打开文件失败!";  
            else  
                fputs($fp,$counter);  
            $_SESSION['temp']=1;   
        }  
        fclose($fp);  
    } 
    ?>
    <p><a href="">友情链接:</a><a href="http://www.wmdfw.com/">钢锅</a><a href="http://www.wmdfw.com/baidu.php">BaiDu.Com</a><a href="http://down.zhouein.com:81">电信线路</a> <a href="http://down2.zhouein.com/">华数线路</a></p>
    <p>Copyright ©2001-<?php echo date("Y") ?> 钢锅 All Rights Reserved.访问量:<b style = 'color:green;'><?php echo $counter?></b>次</p>
    </html>
  • 相关阅读:
    解决Vss链接问题清除Windows共享登录的用户名密码记录(转)
    C# 激活正在运行的程序
    Log4Net 使用方法
    对Javascript闭包的一些理解
    根据数据库获取表名集合,根据表名获取字段信息
    C#引用类型和值类型的区别(转)
    c++强制类型转换:dynamic_cast、const_cast 、static_cast、reinterpret_cast
    理解VC工程文件类型
    MFC中的UpdateData()
    字节对齐
  • 原文地址:https://www.cnblogs.com/zhouein/p/6480784.html
Copyright © 2011-2022 走看看