lets introduce the form first.
in the method, you can set the form sending method,
<form action = "calc.php" method = "GET">
in this case you reach the variables with a $GET array on the next page:
You can set it into POST, and you reach the variables in $POST["variable_name"]
and don't forget to use a " sign.
at the very beggining of your php file put this after the <?php block
error_reporting(E_ERROR | E_PARSE);
//error_reporting(E_ALL);
ini_set("display_errors", 1);
that means, it will only alert you with a message if a parse or another error is in your program.
If you use E_ALL, will shows you the warnings and evry errors...
Its not a bad thing, its good to you if you debug an error, for example:
$monthly = $total/payments;
payments is not a variable, but you want to divide with it...
Warning, if you use an undefined variable, for example:
print $_POST['price']; // if this variable did not get a value, that cause undefined index
To use it not to warn you, before you use a variable, lets check if it has set before,
if(isset($POST['price')])
$price=$POST['price'];