Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Revisit the table you calculated in unit 4. Recall that this script uses client-side JavaScript. The way it works, the web server sends both the

Revisit the table you calculated in unit 4. Recall that this script uses client-side JavaScript. The way it works, the web server sends both the XHTML and the JavaScript to the client's web browser. The browser then executes the JavaScript to produce additional XHTML, which it then renders on the screen.

Rewrite the program to use server-side PHP instead. The syntax of PHP is similar to that of JavaScript; keep in mind the following differences:

PHP uses the print function instead of JavaScript's document.write function.

PHP prefixes a dollar sign ($) on every variable name.

PHP encloses its code in tags, where JavaScript uses ?>.

JavaScript and PHP provide different function libraries. For example, the JavaScript Math.round()and the PHP round() functions work differently.

JavaScript uses "+" to concatenate strings while PHP substitutes values for variables inside a string. With PHP, you cannot calculate and concatenate in one statement.

Submit your pages to the W3C validator (http://validator.w3.org/) and correct all errors.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

JS CODE from Unit 4

Bears Memorabilia Calculator

//Browser results when I enter data and hit submit; need PHP to do the same

image text in transcribed

Fried S PhotoReflect ::: Apps , Dashboard! Credit K e) Best Chicago Bears Memorabilia Total Cost Calculator Home Page This page says: The total sum is 160 OK Input Product Tota 150 Tax Input Sales 5 Input Shipping Costs 5 Submit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Students also viewed these Databases questions

Question

What were the reasons for your conversion or resistance?

Answered: 1 week ago

Question

How was their resistance overcome?

Answered: 1 week ago