Submitting a Form Web developers frequently use PHP to process forms. XHTML forms offer two different methods for communicating form values to a web server: get and post. The server handles both...



Submitting a Form


Web developers frequently use PHP to process forms.


XHTML forms offer two different methods for communicating form values to a web server: get and post.


The server handles both methods similarly by placing the input values into elements of an implicitly declared array, $_GET and $_POST, respectively. In your PHP code, to access a value, use the name of the input field as the subscript. For example, the value of the name form field is either $_GET["name"] or $_POST["name"], depending on the submission method.


The get and post methods differ on the client side. In the get method, the browser appends the field names and values to the URL, like this:


http://localhost/unit6/toys.php?Name=Mystery+Shopper&Age=99&Item=2


The post method transmits the field names and values as part of the XHTML header data and so the user cannot easily see or modify this information.


Open your catalog page from unit 4 in a text editor.


Update the form tag to include method="post" or method="get". In the action attribute, specify the name of a page that will process the submitted form.


Finally, write content for the page you specified. In this case, simply confirm receipt of the order, the date, and all of the field values.




Catalogue of Motorcycle Equipment
––>




Motorcycle Equipment


If you love to ride a Ducati then enter your information.




First name:
Last name:


Motorcycle Equipment






Select
Item
Picture
Description
Price




Buy
Ducati Gloves
Super cool Ducati gloves protect your hands
$65.00




Buy
Ducati Shoes
Super cool Ducati shoes that stick to the peg
$150.00




Buy
Ducati Helmet
Super cool Ducati Helmet to keep your bean safe
$800.00




Buy
Ducati Jacket
Super cool Ducati jacket to keep you warm
$350.00




Ducati Home Page
Ducati Home Page

May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here