0% found this document useful (0 votes)
205 views1 page

PHP Pizza Form

The document contains a simple PHP form for ordering a pizza. It allows the user to select a size (small, medium, or large), choose toppings from a predefined array using checkboxes, and enter their name and phone number. When submitted, the form will send the data to an order.php file via the GET method.

Uploaded by

Drashti Intwala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
205 views1 page

PHP Pizza Form

The document contains a simple PHP form for ordering a pizza. It allows the user to select a size (small, medium, or large), choose toppings from a predefined array using checkboxes, and enter their name and phone number. When submitted, the form will send the data to an order.php file via the GET method.

Uploaded by

Drashti Intwala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

<!

--
Simple form for ordering a pizza.
* Topping choices are specified as an array.
* Topping checkboxes are passed as an array.
-->

<html>
<head><title>Pizza Order Form</title></head>
<body>

<?php
$toppings = array("Olives", "Anchovies", "Onions", "Spinach");
?>
<h2>Pizza Order Form</h2>
<form action="order.php" method="get">

<p> <label for="size"><strong>Size</strong></label><br>


<input type="radio" name="size" value="small">
Small (10 inches)
<br>
<input type="radio" name="size" value="medium">
Medium (12 inches)
<br>
<input type="radio" name="size" value="large">
Large (14 inches)</p>

<p><label for="toppings"><strong>Toppings</strong></label><br>

<?php
foreach ($toppings as $item) {
echo "<input type='checkbox' name='toppings[]' value=$item> $item <br>";
}
?>
</p>

<p><label for="name"><strong>Name:</strong></label>
<input type="text" name="name" size=20></p>

<p><label for="phone"><strong>Phone:</strong></label>
<input type="text" name="phone" size=20> Example: 123-555-1212 or 555-1212
</p>

<p><input type="submit" value="Submit Order"></p>

</form>
</body>
</html>

You might also like