Question: Write a PHP script that computes the total cost of the ordered light bulbs from Exercise 9.9 after adding 6.2 percent sales tax. The program
Write a PHP script that computes the total cost of the ordered light bulbs from Exercise 9.9 after adding 6.2 percent sales tax. The program must inform the buyer of exactly what was ordered, in a table.
So Far, I have this for the previous question I need to work off of...
if ($_SERVER["REQUEST_METHOD"] == "POST") { $name = test_input($_POST["user"]); $checkbox = test_input($_POST["option1"]); $radio = test_input($_POST["option2"]); $array[]=array(2.39,4.29,3.29,7.49); if(empty($checkbox)) { echo("You didn't select any thing."); } else { $N = count($checkbox); for($i=0; $i < $N; $i++) { $count=$count+$array[$checkbox[$i]-1]; } } echo "Name".$name.",Cost:".$count.",Card:".$radio; }
function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } ?>
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
