Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>Bootstrap Example</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- </head>
- <body style="text-align:center">
- <div class="container">
- <h2>SD LAB IV - ASSIGNMENT : 1</h2>
- <form method="post" enctype="multipart/form-data">
- <div class="form-group">
- <label for="multiplicand">ENTER MULTIPLICAND :</label>
- <input style="text-align:center" type="number" class="form-control" id="multiplicand" placeholder="ENTER MULTIPLICAND" name="multiplicandField" required>
- </div>
- <div class="form-group">
- <label for="multiplierL">ENTER LOWEST VALUE OF MULTIPLIER :</label>
- <input style="text-align:center" type="number" class="form-control" id="multiplierL" placeholder="ENTER LOWEST MULTIPLIER" name="multiplierFieldL" required>
- </div>
- <div class="form-group">
- <label for="multiplierH">ENTER HIGHEST VALUE OF MULTIPLIER :</label>
- <input style="text-align:center" type="number" class="form-control" id="multiplierH" placeholder="ENTER HIGHEST MULTIPLIER" name="multiplierFieldH" required>
- </div>
- <button type="submit" class="btn btn-primary" name="submitButton">SUBMIT</button>
- <button type="reset" class="btn btn-danger" name="resetButton">RESET</button>
- </form>
- </div>
- <?php
- if (isset($_POST["submitButton"]))
- {
- $getMultiplicand = $_POST["multiplicandField"];
- $getMultiplierL = $_POST["multiplierFieldL"];
- $getMultiplierH = $_POST["multiplierFieldH"];
- echo "<div class=\"container\" style=\"text-align:center\">";
- echo "<br>" . "<h3>" . "RESULT TABLE" . "</h3>" . "<br>";
- echo "<table class=\"table table-striped table-bordered table-condensed table-responsive table-hover\">";
- echo "<thead>";
- echo "<tr>";
- echo "<th style=\"text-align:center\">MULTIPLICAND</th>";
- echo "<th style=\"text-align:center\">MULTIPLIER</th>";
- echo "<th style=\"text-align:center\">RESULT</th>";
- echo "</tr>";
- echo "</thead>";
- echo "<tbody>";
- for ($i = $getMultiplierL ; $i <= $getMultiplierH ; $i++)
- {
- $result = $getMultiplicand * $i;
- echo "<tr>";
- echo "<td>" . $getMultiplicand . "</td>";
- echo "<td>" . $i . "</td>";
- echo "<td>" . $result . "</td>";
- echo "</tr>";
- }
- echo "</tbody>";
- echo "</table>";
- echo "</div>";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement