Error - please be sure that you are only entering numbers into this field
'; } elseif ($price > 1000000 && $_POST['ratetype']=='refi'){ echo '
We\'re sorry, our online rate table does not go beyond $1,000,000. Please contact us directly for pricing.
'; } elseif ($price > 1000000 && $_POST['ratetype']!='refi'){ echo '
We\'re sorry, our online rate table does not go beyond $1,000,000. Please contact us directly for pricing.
'; } else { //echo $price; $roundupprice = round (($price + 499), -3); // Uses default mode of PHP_ROUND_HALF_UP. //echo "
" . $roundupprice; // Connects to your Database $mysqli = new mysqli("localhost", "trademar_drpl", "2v2JJ8W!kXWa", "trademar_hrates"); // Collects data from "rates" table if ($_POST['ratetype'] == 'refi') { $data = $mysqli->query("SELECT * FROM HomeRates3 where LoanAmount = " . $roundupprice); } elseif ($_POST['ratetype'] == 'purchase') { $data = $mysqli->query("SELECT * FROM HomeRates2 where LoanAmount = " . $roundupprice); } else { echo '
We\'re sorry, an error occured. Please try again, or contact us.
'; } // puts the "rates" info into the $info array $info = $data->fetch_assoc(); // Print out the contents of the entry Print '
Your rate is: $'.$info['RateAmount'] . '
'; //Print "
Loan Amount: ".$info['LoanAmount'] . "
"; } } ?>
Note: Enter ONLY numbers into the loan amount field.