Hello all, I have this function and it seems to kill the rest of the page from loading when called. Everything before this functions being called runs fine, Here is the function code:
$total = 0;
$dir = "/home/fxnsdqzg/public_html/".$username."/";
function spaceUsed($dir){
global $total;
$username = $_SESSION['username@hosting.spechal.com'];
chdir($dir);
if(is_dir($dir)){
if($dh = opendir($dir)){
while(($file = readdir($dh)) !== FALSE){
if (is_dir($dir.$file) && $file != '.' && $file != '..'){
chdir($dir.$file.'/');
spaceUsed($dir);
} else {
$total = filesize($dir.$file);
} //end inner if
} //end while
} //end 2nd outer-if
} closedir($dh); //end outer-if
return $total; } //end function
Here is the way I call it:
echo "<br>Disk Usage: ". spaceUsed($dir) .'/'. alowedspace();
allowedspace() is another function, but it seems to work fine.
THANKS!