Advertisement
Guest User

yeah

a guest
Jan 24th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <html>
  2. <body>
  3. <pre>
  4. <form action = "Com.php" method="post">
  5. Input total sales: <input type="text" name="txtSales">
  6. Type 1: <input type="checkbox" name="chkType" value="1">
  7. Type 2: <input type="checkbox" name="chkType" value="2">
  8. Type 3: <input type="checkbox" name="chkType" value="3">
  9. Type 4: <input type="checkbox" name="chkType" value="4">
  10. <input type="submit" name="btnSubmit" value="Submit">
  11. </form>
  12. <?php
  13. if(isset($_POST["btnSubmit"]))
  14. {
  15. $sales = $_POST["txtSales"];
  16. $types = $_POST["chkType"];
  17.  
  18.  
  19. if($types==='1'){
  20. $amount = $sales*0.07;
  21. if($amount<400)
  22. echo 400;
  23. else
  24. echo $amount;
  25. }
  26. if($types==='2'){
  27. $amount = $sales*0.1;
  28. if($amount<900)
  29. echo 900;
  30. else
  31. echo $amount;
  32. }
  33. if($types==='3'){
  34. $amount = $sales*0.12;
  35. echo $amount;
  36. }
  37. if($types==='4'){
  38. echo 250;
  39. }
  40. }
  41. ?>
  42. </pre>
  43. </body>
  44. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement