This is my script for counting file size in folders, but when I put this script on normal text page it shows error:
Warning: in_array() [function.in-array]: Wrong datatype for second argument in statistics.php on line 20
Warning: in_array() [function.in-array]: Wrong datatype for second argument in statistics.php on line 20
Code:
<?php
if (session_id() == ""){
session_start();
}
$maxupload=1024000000; // in byte
$dir='jdownloads';
$notcount=array('index.html','listing.php','descriptionfile.txt');
dirs($dir);
$sizeinbyte=($_SESSION[tots]==0)?'0':$_SESSION[tots];
$_SESSION[tots]=array();
unset($_SESSION[tots]);
function dirs($dir){
global $notcount;
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if(is_dir($dir.'/'.$file)){
dirs($dir.'/'.$file);
}else{
if (!in_array($file, $notcount)) {
$fl=filesize($dir.'/'.$file);
$_SESSION[tots]=$_SESSION[tots]+$fl;
}
}
}
}
closedir($handle);
}
}
?>
Comment