Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <pre>
- <form action = "Com.php" method="post">
- Input total sales: <input type="text" name="txtSales">
- Type 1: <input type="checkbox" name="chkType" value="1">
- Type 2: <input type="checkbox" name="chkType" value="2">
- Type 3: <input type="checkbox" name="chkType" value="3">
- Type 4: <input type="checkbox" name="chkType" value="4">
- <input type="submit" name="btnSubmit" value="Submit">
- </form>
- <?php
- if(isset($_POST["btnSubmit"]))
- {
- $sales = $_POST["txtSales"];
- $types = $_POST["chkType"];
- if($types==='1'){
- $amount = $sales*0.07;
- if($amount<400)
- echo 400;
- else
- echo $amount;
- }
- if($types==='2'){
- $amount = $sales*0.1;
- if($amount<900)
- echo 900;
- else
- echo $amount;
- }
- if($types==='3'){
- $amount = $sales*0.12;
- echo $amount;
- }
- if($types==='4'){
- echo 250;
- }
- }
- ?>
- </pre>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement