Question: shopping html file payment html file payment cgi file i need the payment cgi to work with the other two files to be inteeactive with





|html) head> link rel="stylesheet" type="text/css" href="Indexstyle.css"> title>Shopping cart /heads body nav> 1ia href="home. html" Home /a/1i 1ia href="information.html" Information /a/1i 1ia href ="login.html" Login /a/1i 1ia href = registration.htm1" Registration /a/1i 1ia href ="userprofile.html" User Profile /a/1i 1ia href="bookcatalog, html" Book Catalog /a/1i 1ia href "shopping.html" Shopping Cart /a/1i 1ia href "payment. html" Payment /a/1i /01 / nav / bodys center? shopping cart /h1/ center table align="center"> etd)eselect? copt group label="select the book") coption value="To Kill a Mockingbird">To kill a Mockingbird foption value-mltee in wonderland">Altee in Honderland 1984">1984 coption value-"More"store Alopt enoup? File toit View /u1 / nav /bodys scentens h1) Shopping cart:/h1) c/centers ctable arten "center"s trtd Text Bookse/td) To kill a Mockingbird (option value -Alice in Wonderland") Alice in wonderland coption value" "1984"s1984 coption values" "More" More. /ept group (tselect) /td eites cform method "post" action" "payment, htwi"s [select name "book selection") (optgroup label-"select the book") coption values"To Ki11 a Mockingbird"sto Kill a Mockingbirule/option? soption value="Alice in Wonderland")Alice in Wonderlands/option c/selects cinput typer "subelt" yalues "Ox"/? /form/td/tr / centen s/ body / hitm1s Shopping cart head title>Payment / head body nav ul > 1 i a href ="home. html" Home /a/1 i 1ia href = "information. html" Information /a/1i 1ia href ="login.html"Login/a/1i lia href="registration. html" Registration /a/1i 1ia href="userprofile.html" User Profile /a/1i 1ia href ="bookcatalog. htm1" Book Catalog /a/1i 1ia href =" shopping. html" Shopping Cart /a/1i 1ia href "payment. html" Payment/1i /u1 / nav center) h1>PAYMENT DETAILS /h1 h2 > ITEM PRICE: \$14,00 S3 TAXES: $5.99/ h3 h4 TOTAL COST /h4 hr> / center > / body / html Home Information Login Registration User Profile Book Catalog Shopping Cart Payment PAYMENT DETAILS ITEM PRICE: $14.00 TAXES:\$5.99 TOTAL COST $19.99 for To Kill a Mockingbird \# Get form data form =cgi. Fieldstorage () \# Get selected book from the form selected_book = form.getvalue ('book_selection') * Define book prices (just made up values) book prices ={ "To Kill a Mockingbird": 14.99, "Alice in Wonderland": 12.99, "1984": 15.99, "More": 9.99 \} \# Calculate item price and tax item price = book_prices[selected_book] tax rate =0.08 \# 8% tax rate (you can adjust this value) tax_anount = item_price tax_rate total_cost = item_price + tax_amount " Display payment details print ("Content-type: text/html ") print ( + head> Payment (link rel="stylesheet" type="text/css" href="Indexstyle.css") / heads body center? PAYMENT DETAILS / h1 (h2) ITEM PRICE: $(:.2f)/h2 (h3)TAXES: $[:.2f}(ha) TOTAL COST: $(:,2f)? hrs ch 5$(1.2f) for (1/ center / body "W., format(item price, tax_amount, total_cost, item_price, selected_book))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
