]here's my code
Code:
case "download":
echo "
<html>
<head>
<title>File Download</title>
</head>
<body>
<center>
";
$list = "<table width=400 border=0 bordercolor=#5A0202 style=\"border-collapse: collapse\">";
$list .= "<tr><td width=400><center>Click To Download</td></tr>";
$dir = opendir($absolute_path);
function rendersize($size) {
$type = 'bytes';
if ($size > '1023') {
$size = $size/1024;
$type = 'KB';
}
if ($size > '1023') {
$size = $size/1024;
$type = 'MB';
}
if ($size > '1023') {
$size = $size/1024;
$type = 'GB';
}
if ($size > '1023') {
$size = $size/1024;
$type = 'TB';
}
// Fix decimals and stuff
if ($size < '10') $size = intval($size*100)/100;
else if ($size < '100') $size = intval($size*10)/10;
else $size = intval($size);
// Comment the following line if you want X.XX KB displayed instead of X,XX KB
$size = str_replace("." , "," , $size);
}
while (false !== ($file = readdir($dir))) {
if (($file != "..") and ($file != ".")) {
$list .= "<tr><td width=400><a href=$dl/$file>$file</a></td></tr>";
}
}
$list .= "</table>";
echo $list;
echo"
</center>
</body>
</html>";
Fatal error: Cannot redeclare rendersize() in /home/wooolf/WWW/updown.php on line 45
where line 45 is
Code:
function rendersize($size) {
Am I completely useless? :disappointed: