Php > Look and Feel
Nice looking dir index'r
Nice looking dir index'r
index
file
size
last modified
// shows the correct size & size-label function size($file) { $size_label = array("Byte", "KB", "MB", "GB", "TB"); $size=filesize($file); for ($c=0;$size>1024; $c++) { $size/=1024; } $size=round($size,1); return("$size ".$size_label[$c]); } $trbg = "1"; // which
- background // reading the content and... $mydir = dir("./"); while ($file=$mydir->read()){ $kind = filetype($file); if ($kind != "dir"){ // ATTENTION! if you want this file to show subdirectories, remove this query //... showing the content: //
- backgroundcolor echo "
"; if ($trbg=="1"){ echo "
"; $trbg = "2"; } else if ($trbg=="2"){ echo "
"; $trbg = "1"; } //
and filename... echo "
".$file."
"; //...filesize... echo "
".size($file)."
"; //... last change... $change = filemtime($file); echo "
".date("j. - M. - Y; H:i:s",$change)."
"; } } $mydir->close(); ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage