subject

Build the Product Discount application This exercise steps you through the process of building the Product Discount application. Open the files for the Product Discount application 1. Make sure the Apache server is running. Then, start your browser and run the application in this directory: xampp\htdocs\ex_starts\ch02_ex1 To do that, you can use the index of exercise starts that you bookmarked in exercise 1-2 or you can use this URL: http://localhost/ex_starts/ch02_ex1
2. Enter valid data in the three text boxes, and click the Calculate button. Note that the resulting web page indicates that it is under construction.
3. Use your IDE or text editor to open the display_discount. php file for this application. It is in the same folder as the index. html file. Then, note that this file doesn’t contain the PHP statements that this application needs.
4. Use your IDE or text editor to open the index. html file for this application. Then, note the name attributes for the three text boxes. Add the PHP statements
5. Switch to the display_discount. php file and add statements that use the $_POST array to get the product description, list price, and discount percent from the form. Then, modify the first three echo statements so they display this data, save the file, and run the application again. This should display unformatted versions of the data that you enter.
6. Switch to the display_discount. php file and change the statements that use the $_POST array to use the filter_input function instead. Save the file and run the application to make sure it still works as expected.
7. Switch to the display_discount. php file and add statements that calculate the discount amount and discount price. Then, modify the last two echo state- ments so they display this data, save the file, and run the application. This time, the application should display unformatted versions of the calculated data.
8. Switch to the display_discount. php file and add statements that format the numeric variables with the currency and percentage formats. Then, modify the last four echo statements so they display the formatted data, save the file, and run the application. Now, the application should display the formatted data.
9. Keep the application running and navigate to the index. html page if you’re not already there. In the Product Description textbox, enter "Guitar", and in the Discount Percent textbox, enter "10". Click the Calculate Discount button, and notice that the Product Description value is displayed in bold, and the Standard Discount value is displayed in italics.
10. Switch to the display_discount. php file and add the htmlspecialchars function to the echo statements for Product Description, List Price, and Standard Discount. Then save the file, run the application, and repeat step 9. Notice that this time, the HTML tags are displayed as HTML entities, rather than being implemented by the browser.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
Technician a says that the radiator usually cools better if the front air dam is removed. technician b says that when a condenser has a leak it can be repaired easily with epoxy. who is correct?
Answers: 1
question
Computers and Technology, 22.06.2019 21:00
Ulia is planning to attend the same private four-year college her parents attended. she wants to save at least $18,000 in four years to contribute to her college education. which monthly deposit amounts can julia use to achieve her goal? check all that apply.
Answers: 2
question
Computers and Technology, 23.06.2019 10:00
Install and use wireshark program ( send back screen shots and other vital information) case project 3-2: decode a tcp segment in a wireshark capture in this chapter, you walked through tcp segment to interpret the data included in its header. in this project, you use wireshark to capture your own http messafes, examine the tcp headers, and practice interpreting the data you'll find there. 1. open wireshark and snap the window to one side of your screen. open a browser and snap that window to the other side of your screen so you can see both windows.
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Jake really works well with numbers and is skilled with computers but doesn't work well with others. which of the jobs discussed in this unit might be best for jake? why?
Answers: 3
You know the right answer?
Build the Product Discount application This exercise steps you through the process of building the P...
Questions
question
Mathematics, 11.02.2021 18:20
question
Mathematics, 11.02.2021 18:20
question
Mathematics, 11.02.2021 18:20
Questions on the website: 13722359