Computers and Technology

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 23:00, brooklynmikestovgphx
Suppose s, t, and w are strings that have already been created inside main. write a statement or statements, to be added to main, that will determine if the lengths of the three strings are in order by length, smallest to largest. that is, your code should determine if s is strictly shorter than t, and if t is strictly shorter than w. if these conditions hold your code should print (the boolean value) true. if not, your code should print false. (strictly means: no ties) example: if s, t, and w are "cat", "hats", and "skies" your code should print true - their lengths are 3-4-5; but if s, t, and w are "cats" "shirt", and "trust", then print false - their lengths are 4-5-5 enter your code in the box below
Answers: 2
image
Computers and Technology, 23.06.2019 09:30, GEEKLIFE6598
After you present a proposal, the committee starts asking you questions, some beyond the strict focus of your proposal. they ask questions about implications in other fields and knowledge about other fields. you are asked to redo your proposal. what is most likely missing? breadth of material depth of material clarity of material details of material
Answers: 1
image
Computers and Technology, 24.06.2019 17:50, jones03riley
You work in the accounting department and have been using a network drive to post excel workbook files to your file server as you complete them. when you attempt to save a workbook file to the drive, you see the error message: “you do not have access to the folder ‘j: \’. see your administrator for access to this folder.” what should you do first
Answers: 2
image
Computers and Technology, 24.06.2019 19:00, stephanieanaya7
In python a floating-point number must be written using scientific notation?
Answers: 1
Do you know the correct answer?
Build the Product Discount application This exercise steps you through the process of building the P...

Questions in other subjects: