I have a contract page with PHP doing the math to create a subtotal and then a final total. This piece of code is a problem:
<?php
$fsub1 = $area + $fp2story + $fpbonus + $fpfinbsmt + $fpattgarage + $fpbsmtgarage + $fpporch + $fpdeck + $fpbalc + $fpspecglaze + $fpsunken + $fpdormer + $fpvolceil + $fpspecstair + $fpbrick + $fpbeams + $fpangled + $fpwobsmt + $fpmisc1 + $fpmisc2 + $fpmisc3 + $fpmisc4 + $fpmisc5 + $fpmisc6;
if($fsub1 > 0) {print number_format($fsub1, 2, '.', ',');
}
else {print "";
}
?>
Some HTML in here and then:
<?php
$pangled = $esub1 * .20;
if($line["angled"] = 'T') {print number_format($pangled, 2, '.', ',');
}
else {print "";
}
?>
The code appears to be bypassing my if statement and just outputting the variable, so even when the field (angled) is NULL, PHP is still doing the math and outputting it to the form.
What am I missing?