Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- # Because we are learning, this code will report all errors and notices. We wouldn't put this in production code.
- error_reporting(E_ALL);
- # This file processes data sent from order.html
- $customer_name = $_REQUEST['customer_name'];
- $qty = $_REQUEST['qty_of_pizza'];
- $comments = $_REQUEST['customer_comments'];
- $toppings= $_REQUEST['toppings'];
- $number_of_toppings = count($toppings);
- $total_cost = $qty * 25;
- echo "<p>Thank you for your order, $customer_name!
- You have ordered $qty pizzas.</p>
- <p>You have requested $number_of_toppings toppings: </p>
- ";
- echo "<ul>";
- foreach ($toppings as $value) {
- echo "<li>$value </li>";
- }
- echo "</ul>";
- echo "At 25 PLN per pizza, your total cost will be $total_cost.</p>
- <p>Your comments, which we read carefully,
- are here: $comments";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement