\nFile Information Table\n"; $outhtml .= ' '; $outhtml .= "\n"; $outhtml .= "

File Information Table

"; $outhtml .= "
"; $outhtml .= "Filepath (or URL):

"; $outhtml .= "Filespec (or Name):

"; $outhtml .= ""; $outhtml .= "


... or ...

"; $moi = $_SERVER['PHP_SELF']; if (1 == 1) { // Thanks to http://www.html5rocks.com/en/tutorials/file/dndfiles/ $outhtml .= ''; if (isset($_POST['prelist'])) { $outhtml .= '
' . urldecode($_POST['prelist']) . '

' . ''; } else { $outhtml .= ''; } $outhtml .= '


... or ...

Read bytes: '; } else { $outhtml .= '
Browse for local file
'; } $outhtml .= "
"; $outhtml .= ""; } else { $outhtml = "File Information Table for " . $dir . $fsp . $ext . "\n"; $outhtml .= "

File Information Table for " . $dir . $fsp . $ext . "

"; if ($dir == "") { $outhtml .= ""; } else { $outhtml .= ""; } if (strpos($dir . $fsp . $ext, "https:") !== false || strpos($dir . $fsp . $ext, "http:") !== false || strpos($dir . $fsp . $ext, "HTTPS:") !== false || strpos($dir . $fsp . $ext, "HTTP:") !== false) { if (url_exists($dir . $fsp . $ext)) { $cdt = ""; $cont = file_get_contents($dir . $fsp . $ext); $recs = explode("\n", $cont); $words = explode(" ", $cont); $h = get_headers($dir . $fsp . $ext, 1); // Thanks to http://stackoverflow.com/questions/845220/get-the-last-modified-date-of-a-remote-file $cdt = ""; try { $cdt = $h['Last-Modified']; } catch (Exception $exxx) { $cdt = ""; } $outhtml .= ""; } } else { foreach (glob($dir . $fsp . $ext) as $filename) { if (url_exists($filename)) { $lines = file($filename); $cwords = 0; foreach ($lines as $line) { $cwords += str_word_count($line); } $outhtml .= ""; } } } $outhtml .= "
FilenameDateSize (bytes)LinesWords
Filename in " . $dir . "DateSize (bytes)LinesWords
" . str_replace($dir, "", $dir . $fsp . $ext) . "" . $cdt . "" . strlen($cont) . "" . count($recs) . "" . count($words) . "
" . str_replace($dir, "", $filename) . "" . date("F d Y H:i:s", filemtime($filename)) . "" . filesize($filename) . "" . count($lines) . "" . $cwords . "
"; } echo $outhtml; ?>