View Single Post
Old 02-28-2005, 12:45 AM  
iam
Senior Member
 
Join Date: Mar 2004
Posts: 289
Default Re: quickfix: Warning: Division by zero in D:\ioFTPD\scripts\psio\funcs.php on line 4

Quote:
Originally posted by odog
saw you guys had some problem with this error when uploading a file and no sfv exists. this gets rid of the msg.
and yes i know it aint all that nice but atleast it works!
replace in funcs.php (at the top of the file):

function progressmeter($total,$found) {
$dpercent = round($found/$total,1);
$bars = round(20*$dpercent,0);
return str_repeat("#",$bars).str_repeat("-",20-$bars);
}

with

function progressmeter($total,$found) {
if ( $total == "" ) {
return str_repeat("#",0).str_repeat("-",20-0);
} else {
$dpercent = round($found/$total,1);
$bars = round(20*$dpercent,0);
return str_repeat("#",$bars).str_repeat("-",20-$bars);
}
}
thx, working
iam is offline