Some Help Please
Posted: Wed Aug 18, 2004 10:33 pm
One thing I need to change about this script is to make the filename a link so people can download them, and after the file size I need it to say bytes.
Thats basically it, not very hard but I dont know very much just need some quick assistance.
?>
Thats basically it, not very hard but I dont know very much just need some quick assistance.
Code: Select all
<?php
echo "<table border='1' bordercolor='#D2D2D2' cellpadding='1' cellspacing='1' width='100%'>";
// Ensure $dir has a trailing backslash
$dir = 'music/Alternative/';
$opened = opendir($dir);
while( false !== ($file = readdir($opened))) {
if($file != "." && $file != ".." && !is_dir($file)) {
$type = filetype($dir.$file);
$size = filesize($dir.$file);
$store[$file] = array($file,$size,$type);
}
}
closedir($opened);
asort($store);
foreach($store as $key => $value) {
echo "<tr><td width='50%'>{$value[0]}</td><td width='20%'>{$value[1]}</td><td width='30%'>{$value[2]}</td></tr>";
}
echo "</table>";
exit();
?>