// Do not display .. in the root

// Do not display .. in the root folder if ($currentFolder == $username) { if ($file == “..”) { continue; } } Get the absolute path of the $file: $absoluteFilePath = getAbsolutePath($currentFolder . “/” . $file); Generate a row for each element of the folder: printf(”
n”); printf(”
n”); Display the name of the element: if (is_dir($absoluteFilePath)) { If the element is a folder, then the HTML anchor element points to the viewfolder.phpfile: printf(” %s n”, urlencode($file), $file); } else { If the element is a file then the HTML anchor element points to viewfile.php: printf(” %s n “, urlencode($file), $file); } printf(”

n”); Display the size of the element: printf(”
%s

n”, filesize($absoluteFilePath)); Get and display the last modified time of the element: printf(”
%s

n”, date(”m/d/Y h:I:s”, filectime($absoluteFilePath))); printf(”

n”); } Close the directory: Page 265
Note: If you are looking for good and high quality web space to host and run your java application check Vision java hosting services

Comments are closed.