I’ve tried to port the following sum in a php for loop

this way:
$prod = 1;
for($i=0;$i<$_POST["capacity"];$i++){
$prod = $prod * (($_POST["capacity"] - (i+1)) / $toffered);
}
?>
p(c) is: <?php echo floatval(1.00/floatval((1+ floatval($prod)))); ?><br /> <br />
but for some reason it seems to give me the wrong result. Any hints on what is wrong?
EDIT:
i’ve modified the initial value of prod as well as adding brackets for i+1 which is subtracted from the capacity. The results aren’t better still.
works!