Question: This is the assignment: Create an HTML form for taking numeric values. Create a PHP script that receives the form data, performs some calculations, formats
This is the assignment:
Create an HTML form for taking numeric values. Create a PHP script that receives the form data, performs some calculations, formats the values, and prints the results. Format a floating point with 2 decimal places and another with 3 decimal places. The HTML is what the calculator should look like, it's the PHP code that I need assistance with.
Here is my HTML:
Please complete this form:
Here is my PHP:
// Calculate the total: $add = $add1 + $add2; $multiply = $multiply1 * $multiply2; $divide = $divide1 / $divide2 $subract = $subract1 - $subract2
// Apply proper formatting: $multiply = number_format($multiply, 2); $divide= number_format($divide, 3);
// Print out results: print "
$add + $add1 .
";?>
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
