Advertisement
droidus

Untitled

Jun 14th, 2011
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.05 KB | None | 0 0
  1. if ($handle = opendir('.')) {
  2.     print ("<form action='' method='post' id='deleteFiles' name='deleteFiles' > <table border=1 cellpadding=5 cellspacing=0>
  3. <TR><TH>File Name</TH><th>File Size</th><th>Delete File?</th></TR>");
  4.     while (false !== ($file = readdir($handle))) {
  5.         if ($file != "." && $file != ".." && (!(is_dir($file)))) {
  6.             print("<TR><Td>");
  7.             if ((pathinfo($file, PATHINFO_EXTENSION)) == "mp4")
  8.             {          
  9.                 $_SESSION['videoFile'] = $_SESSION['user']."/".$file;
  10.                 echo "<a href='../../video/play.php' target='_blank'>$file</a>\n\n";
  11.             }
  12.             else
  13.             {
  14.                 echo "<a href='$file\'>$file</a>\n";
  15.             }
  16.             print("</td><td>");
  17.             $fileSize = round(((filesize($file))/1024/1024),4);
  18.             echo $fileSize." MB <br>";
  19.             $count += 1;
  20.             $usedStorage = $fileSize + $usedStroage;
  21.             print("</td>");
  22.             print ("<td align='center'><input name='\' type='checkbox' value='$file' /></td>");
  23.         }
  24.         print("</tr></table>");
  25.     }
  26.     closedir($handle);
  27. }
  28. print("<input name='submitDeletedFiles' type='button' value='Submit' /></form>");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement