Advertisement
Guest User

Untitled

a guest
Sep 20th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <?php
  2.  
  3. # Because we are learning, this code will report all errors and notices. We wouldn't put this in production code.
  4. error_reporting(E_ALL);
  5.  
  6. # This file processes data sent from order.html
  7.  
  8. $customer_name = $_REQUEST['customer_name'];
  9. $qty = $_REQUEST['qty_of_pizza'];
  10. $comments = $_REQUEST['customer_comments'];
  11. $toppings= $_REQUEST['toppings'];
  12. $number_of_toppings = count($toppings);
  13. $total_cost = $qty * 25;
  14.  
  15.  
  16.  
  17. echo  "<p>Thank you for your order, $customer_name!
  18. You have ordered $qty pizzas.</p>
  19. <p>You have requested $number_of_toppings toppings:  </p>
  20. ";
  21.  
  22. echo "<ul>";
  23. foreach ($toppings as $value) {
  24.  
  25. echo "<li>$value </li>";
  26.  
  27. }
  28.  
  29. echo "</ul>";
  30.  
  31. echo "At 25 PLN per pizza, your total cost will be $total_cost.</p>
  32. <p>Your comments, which we read carefully,
  33. are here: $comments";
  34.  
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement