Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Download</title>
- <link rel="icon" type="image/ico" href="icon.ico">
- </head>
- <body>
- <?php
- $myDirectory = opendir("_Download");
- while(false !== ($entry = readdir($myDirectory))) {
- $dirArray[] = $entry;
- }
- closedir($myDirectory);
- $indexCount = count($dirArray);
- sort($dirArray);
- print("<TABLE border=1 cellpadding=10 cellspacing=0 class=whitelinks>\n");
- print("<TR><TH>Filename</TH><th>Filesize</th></TR>\n");
- for($index=0; $index < $indexCount; $index++) {
- if (substr("$dirArray[$index]", 0, 1) != "."){
- print("<TR><TD><a href=\"_Download/$dirArray[$index]\">$dirArray[$index]</a></td>");
- print("<td>");
- $size = filesize("_Download/$dirArray[$index]");
- $size = $size/1024/1024;
- $size = number_format($size, 2);
- print("$size MB");
- print("</td>");
- print("</TR>\n");
- }
- }
- ?>
- </body>
- </html>
- <?php
- function Redirect($url, $permanent = false)
- {
- header('Location: ' . $url, true, $permanent ? 301 : 302);
- exit();
- }?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement