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 12:00
The following function returns a string of length n whose characters are all 'x'. give the order of growth (as a function of n) of the running time. recall that concatenating two strings in java takes time proportional to the sum of their lengths. public static string f(int n) { if (n == 0) return ""; if (n == 1) return "x"; return f(n/2) + f(n - n/2); } options: a) constant b) logarithmic c) linear d) linearithmic e)quadratic f)cubic g) exponential
Answers: 2
question
Computers and Technology, 22.06.2019 15:30
Whats are the different parts of no verbal comunication, especially body language?
Answers: 3
question
Computers and Technology, 22.06.2019 19:30
Avariable definition defines the name of a variable that will be used in a program, as well as
Answers: 3
question
Computers and Technology, 22.06.2019 23:30
What are listed in the vertical columns across the top of the event editor? a. file names b. conditions c. check marks d. action types
Answers: 1
You know the right answer?
Build the Product Discount application This exercise steps you through the process of building the P...
Questions
Questions on the website: 13722362