Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <body>
- <form id="frm1" action="form_processor.php" method="post">
- Input number of the rows: <input type="text" value="" name="m">
- </form>
- <script>
- function functionm(){
- var z1=document.forms["frm1"];
- var z2=z1.elements[0].value;
- alert(z2);
- }
- </script>
- <button onclick="functionm()">Number of the rows: </button>
- <?php
- $a=$_POST['m'];
- $b=2;
- echo "<table border='1'><br />";
- for ($row = 0; $row < $a; $row ++) {
- echo "<tr>";
- for ($col = 1; $col <= $b; $col ++) {
- echo "<td>", ($col + ($row *$b)), "</td>";
- }
- echo "</tr>";
- }
- echo "</table>";
- ?>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement