Question: Write a PHP script that accepts HTTP GET and POST requests. When sent a GET request, your script should generate HTML markup containing a simple

Write a PHP script that accepts HTTP GET and POST requests. When sent a GET request, your script should generate HTML markup containing a simple form with a text input box like that shown below. Page 4 of 6 The user is allowed to enter simple XML into the text box to perform an arithmetic operation, by specifying the type of operation: add/subtract/multiply/divide, and a pair of numbers on which to perform the operation. When the user clicks the Submit button shown above, the PHP script should be sent a POST request with the XML entered by the user. Your script will need to parse the XML to perform the requested arithmetic operation. Ensure that your script can parse and understand the XML code below and perform the requested add operation. add 5 3 The parser should also be able to handle the other arithmetic operations including subtract, multiply and divide. It should also report parse errors and invalid arithmetic operations, and handle divide-by-zero errors.

Write a PHP script that accepts HTTP GET and POST requests. When

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!