Debt Consolidation - Find jobs - Debt Consolidation - ID badge templates - Debt Consolidation

PDA

View Full Version : File hosting php script problem


PashaM
Apr 23rd 2007, 1:00 am
I am using a File Hosing script on my site. (called "FreeFileHosing")
I got this error out of the blue, i didnt change anything, it just happened:
"Fatal error: Call to undefined function: total_size() in /var/www/html/ffh/index.php on line 38"
What could be the problem?

this is the relavent code in index.php:

$fileshosted=sizeof(file("./files.txt")); //get the # of files hosted

$sizehosted = 0; //get the storage size hosted
$handle = opendir("./storage/");
while($file = readdir($handle)) {
$sizehosted = $sizehosted + filesize ("./storage/".$file);
if((is_dir("./storage/".$file.'/')) && ($file != '..')&&($file != '.'))
{
$sizehosted = $sizehosted + total_size("./storage/".$file.'/');
}
}
$sizehosted = round($sizehosted/1024/1024,2);

moin
Apr 23rd 2007, 2:39 am
Hello friends,

Could anyone suggest me code for string validation, for example, if anyone enters numbers in string then an error message should be displayed.

Thanks.

Subikar
Apr 23rd 2007, 4:47 am
Your total_size() function is unavalable in the script so it is giving error.

PashaM
Apr 26th 2007, 4:02 pm
Your total_size() function is unavalable in the script so it is giving error.

What exactly means "unavailable" ? How do i make it abailable?
this is the link to this error:
http://www.maloestado.com/ffh/

Adam A Flynn
Apr 26th 2007, 5:20 pm
total_size() isn't a native PHP function. The file in your script where it is declared probably isn't included or something.

PashaM
Apr 26th 2007, 6:02 pm
this is the line 38 of that file that gives error:
$sizehosted = $sizehosted + total_size("./storage/".$file.'/');

so you'r saying that this total_size variable should be defined somewhere else? and isn't there supposed to be a $ in front of total_size in that line?

PashaM
Apr 26th 2007, 6:10 pm
ok, thanks everyone! You pointed me into a right direction... All is fixed and working now