Mortgage Calculator
Enter your Loan Amount, Rate, and Term (in years) to find your monthly payment. This calculator offers greater flexibility than our standard calculator to the left.
/* function payment($term, $rate, $pval){ $rate = $rate / 100; $i = $rate / 12; $n = $term * 12; $monthpay = ($pval * $i) / (1 - pow((1 + $i), -$n)); return $monthpay; } */ $pval = false; if ($_POST['pval']){ $pval = $_POST['pval']; $pval = strip_tags($pval); } $pval = rtrim($pval,"."); $pval = trim($pval,"$,. "); $pval = split("[,]",$pval); $pval = implode("",$pval); $pval = split("[.]",$pval); $pval = $pval[0]; if (ereg ("([a-z,A-Z])", $pval)){ print "No Letters Allowed"; $pval = ''; }else{ if ($pval){ $pvalu = number_format($pval,2,'.',','); }else{ $pval = ''; } } $arate = false; if ($_POST['arate']){ $arate = $_POST['arate']; $arate = strip_tags($arate); } if (ereg ("([a-z,A-Z])", $arate)){ print "No Letters Allowed"; $arate = ''; } $termy = false; if ($_POST['termy']){ $termy = $_POST['termy']; $termy = strip_tags($termy); } if (ereg ("([a-z,A-Z])", $termy)){ print "No Letters Allowed"; $termy = ''; } if ($pval && $arate && $termy){ ?>Your monthly payment on a $=$pvalu;?> loan at =$arate;?>% for =$termy * 12;?> months or =$termy;?> years would be $=number_format(payment($termy,$arate,$pval),2,'.',',');?>
}?>