Advertisement
droidus

Untitled

Jun 20th, 2011
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.69 KB | None | 0 0
  1. if ($handle = opendir('uploads')) {
  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><th>Date Last Modified</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']."/uploads/".$file;
  10.                 echo "<a href='../../video/play.php' target='_blank'>$file</a>\n\n";
  11.             }
  12.             else if ((pathinfo($file, PATHINFO_EXTENSION)) == "txt")
  13.             {          
  14.                 $_SESSION['editDocumentText'] = $_SERVER['DOCUMENT_ROOT'] . "users/" . $_SESSION['user']."/uploads/".$file;
  15.                 echo "<a href='../../wysiwyg/text_editor.php' target='_blank'>$file</a>\n\n";
  16.             }
  17.             else if ((pathinfo($file, PATHINFO_EXTENSION)) == "mp3")
  18.             {
  19.                 $_SESSION['musicFile'] = $_SESSION['user']."/uploads/".$file;
  20.                 $_SESSION['songName'] = $file;
  21.                 echo "<a href='../../music_player/iPlay.php' target='_blank'>$file</a>\n\n";
  22.             }
  23.             else
  24.             {
  25.                 echo "<a href='uploads/$file'>$file</a>\n";
  26.             }
  27.             print("</td><td>");
  28.             $fileSize = round(((filesize($file))/1024/1024),4);
  29.             echo $fileSize." MB <br>";
  30.             $usedStorage = $fileSize + $usedStroage;
  31.             print("</td>");
  32.             print ("<td align='center'><input name='\' type='checkbox' value='$file' /></td>");
  33.             print ("<td>" . date ('F d Y H:i:s.', filemtime($file)) . "</td>");
  34.         }
  35.     }
  36.     print("</tr></table>");
  37.     closedir($handle);
  38. }
  39. print("<br><input type='button' name='submitDeletedFiles' value='Delete the Checked Files' /></form>");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement