Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!--
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
- -->
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Tablica mnozenja</title>
- </head>
- <style>
- table, th, tr {
- border: 1px solid black;
- border-collapse: collapse;
- }
- th, td {
- padding: 5px;
- text-align: center;
- }
- </style>
- <body>
- <form action="index.php" method="post">
- <p>Unesite opseg tablice mnozenja</p>
- <p>Broj: <input type="number" name="broj" /></p>
- <p><input type="submit" name="submit" value="Upisi" /></p>
- <?php
- if(!empty($_POST["broj"])) {
- $broj = $_POST["broj"];
- echo '<table border="1">';
- for($a = 1; $a <= $broj; $a++) {
- $rez = $a * $broj;
- echo "<tr>";
- echo "<td>";
- echo $broj;
- echo "<td>";
- echo "X";
- echo "<td>";
- echo $a;
- echo "<td>";
- echo "=";
- echo "<td>";
- echo $rez;
- echo "</tr>";
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement