PHP Directory browsing

Source: Internet
Author: User

<! DOCTYPE html>table{Border-collapse:collapse; }table,Td{border: 2px Solid#A8a8de;Padding5px 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>PHPSwitch($_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"; Echo"<table>\n"; Echo"<tr><th> file name </th><th> size </th><th> Add date </th></tr>\n\r";  while($file=Readdir($open _dir)){        if($file! = "." &&$file!= ".."){           if(PathInfo($file, pathinfo_extension) = = "Zip"){             Echo"<tr>\n <td align= ' left ' >\n \n < A href= ' down.php?down_id= '.$file. "' target= ' _blank ' title= ' click to Download ' > '.$file. "</a>\n </td>\n"; if(filesize($file) < 1024){                Echo"<td align= ' right ' >".round(filesize($file), 2). "Byte</td>\n"; }             ElseIf(filesize($file) < 1024*1024){                Echo"<td align= ' right ' >".round(filesize($file) (/1024,2). "Kb</td>\n"; }             ElseIf(filesize($file) < 1024*1024*1024){                Echo"<td align= ' right ' >".round(filesize($file)/(1024*1024), 2). "Mb</td>\n"; }                Echo"<td>".Date(' Y-m-d h:i:s ',Filemtime($file)) . "</td>\n </tr>\n"; /*echo "<td>". PathInfo ($file, pathinfo_extension). "</td></tr>"; */            }           if(PathInfo($file, pathinfo_extension) = = "ISO"){             Echo"<tr>\n <td align= ' left ' >\n \n < A href= ' down.php?down_id= '.$file. "' target= ' _blank ' title= ' click to Download ' > '.$file. "</a>\n </td>\n"; if(filesize($file) < 1024){                Echo"<td align= ' right ' >".round(filesize($file), 2). "Byte</td>\n"; }             ElseIf(filesize($file) < 1024*1024){                Echo"<td align= ' right ' >".round(filesize($file) (/1024,2). "Kb</td>\n"; }             ElseIf(filesize($file) < 1024*1024*1024){                Echo"<td align= ' right ' >".round(filesize($file)/(1024*1024), 2). "Mb</td>\n"; }                Echo"<td>".Date(' Y-m-d h:i:s ',Filemtime($file)) . "</td>\n </tr>\n"; /*echo "<td>". PathInfo ($file, pathinfo_extension). "</td></tr>"; */            }           if(PathInfo($file, pathinfo_extension) = = "EXE"){             Echo"<tr>\n <td align= ' left ' >\n \n <a href= ' down.php?down_id= '.$file. "' target= ' _blank ' title= ' click to Download ' > '.$file. "</a>\n </td>\n"; if(filesize($file) < 1024){                Echo"<td align= ' right ' >".round(filesize($file), 2). "Byte</td>\n"; }             ElseIf(filesize($file) < 1024*1024){                Echo"<td align= ' right ' >".round(filesize($file) (/1024,2). "Kb</td>\n"; }             ElseIf(filesize($file) < 1024*1024*1024){                Echo"<td align= ' right ' >".round(filesize($file)/(1024*1024), 2). "Mb</td>\n"; }                Echo"<td>".Date(' Y-m-d h:i:s ',Filemtime($file)) . "</td>\n </tr>\n"; /*echo "<td>". PathInfo ($file, pathinfo_extension). "</td></tr>"; */            }         }    }  Echo"</table>\n";$countfile= "Tongji.txt"; if(($fp=fopen("Tongji.txt", "r+")) ==false)  {      Echo"Failed to open file!" "; }  Else  {      $counter=fgets($fp, 1024); if(Empty($_session[' Temp ']))      {          $counter++; if(($fp=fopen("Tongji.txt", "w")) ==false)              Echo"Failed to open file!" "; Else              fputs($fp,$counter); $_session[' Temp ']=1; }      fclose($fp); } ><p><a href= "" > Links: </a><a href= "http://www.wmdfw.com/" > Steel pot </a><a href= "http ://www.wmdfw.com/baidu.php ">baidu.com</a><a href=" http://down.zhouein.com:81 "> Telecom lines </a> < A href= "http://down2.zhouein.com/" > Number of lines </a></p><p>copyright 2001-<?phpEcho Date("Y")?> steel pot All rights Reserved. Traffic: <b style = ' color:green; ' ><?phpEcho $counter?></b> Times </p>

PHP Directory browsing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.