Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Week 4 Save the following code as an HTML file on your computer. Online Order Form Online Order Form Product Quantity Milk Chocolate Assorted Fine Chocolate Assorted Milk and Dark Chocolate Note: the...

1 answer below »
Week 4
Save the following code as an HTML file on your computer.
!DOCTYPE html
html lang="en"
head
!-- Required meta tags --
meta charset="utf-8"
meta name="viewport" content="width=device-width,
initial-scale=1, shrink-to-fit=no"
title>Online Order Form
title
style type="text/css"
table {
order: 1px solid black;
order-collapse: collapse;
ackground: #fff;
}
th, td {
order: 1px solid black;
padding: .2em .7em;
color: #000;
font-size: 16px;
font-weight: 400;
}
thead th {
ackground-color: #1A466A;
color: #fff;
font-weight: bold;
}
input[type=text] {
text-align: right;
width: 200px;
color: #000;
}
input[type="number"] {
width: 3em;
}
.button {
order: 1px solid #273746;
order-radius: 5px;
padding: 4px;
ackground-color: #273746;
color: #fff;
}
.default {
ackground-color: #fff;
color: #000;
}
.container {
margin: 10px;
}
style
head
ody >h4>Online Order Form
h4
form action="http:
localhost/week3/processonlinedata.php"
method="post"
table >thead
t
th >Product
th
th >Quantity
th
t
thead
tbody
t
td>Milk Chocolate
td
td
input type="number" name="milkchocolate" min="0"
equired

td
t
t
td>Assorted Fine Chocolate
td
td
input type="number" name="assortedfine" min="0"
equired

td
t
t
td>Assorted Milk and Dark Chocolate
td
td
input type="number" name="assortedmilk" min="0"
equired

td
t
tbody
table
p
input type="submit" value="Submit" >input type="reset" value="Clear" >p
form
ody
html
Note: the above HTML code is supposed to send FORM to a PHP script named
processonlinedata.php in htdocs/week3 folder using the POST method.
Create week3 subfolder in your htdocs folder.
Create a php script named processonlinedata.php that does the following:
1. read the input data into appropriate variables
2. Calculate and display the total cost, total number of items, 5% taxes, and the total
amount (total cost + taxes).
Total cost = cost of a milk chocolate * milk chocolate quantity
+ cost of a assorted fine chocolate * assorted fine chocolate quantity
+ cost of assorted milk and dark chocolate * assorted milk and dark chocolate quantity
Use the following values:
cost of a milk chocolate : $2.50
cost of a assorted fine chocolate: $4.99,
cost of a assorted milk and dark chocolate: $5.75.
Sample output
Number of milk chocolates: 6
Number of assorted fine chocolates: 5
Number of assorted milk and dark chocolates: 10
Total cost: $97.45
5% Taxes: $4.87
Total amount: $102.32
How to submit: submit only the PHP file in a Zip file.
Note: you may use the postback method and include both HTML and PHP codes in a
single .php file.
Answered 2 days After Sep 21, 2021

Solution

Arun Shankar answered on Sep 24 2021
139 Votes
";
echo "Number of assorted fine chocolates: $assortedfine"."
";
echo "Number of assorted milk and dark chocolates: $assortedmilk"."
";
echo "Total cost = $$cost"."
";
$tax = 0.05 * $cost;
echo "5% Taxes: = $$tax"."
";
$total = $cost + $tax;
echo "Total cost: = $$total";
?>
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here