Advertisement
Guest User

Untitled

a guest
Aug 30th, 2015
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <body>
  2.    
  3.  
  4.  
  5. <form id="frm1" action="form_processor.php" method="post">
  6.     Input number of the rows: <input type="text" value="" name="m">
  7.     </form>
  8. <script>
  9.     function functionm(){
  10.     var z1=document.forms["frm1"];
  11.     var z2=z1.elements[0].value;
  12.     alert(z2);
  13.     }
  14. </script>
  15.     <button onclick="functionm()">Number of the rows: </button>
  16.  
  17. <?php
  18. $a=$_POST['m'];
  19.     $b=2;
  20. echo "<table border='1'><br />";
  21.  
  22. for ($row = 0; $row < $a; $row ++) {
  23.    echo "<tr>";
  24.  
  25.    for ($col = 1; $col <= $b; $col ++) {
  26.         echo "<td>", ($col + ($row *$b)), "</td>";
  27.    }
  28.  
  29.    echo "</tr>";
  30. }
  31.  
  32. echo "</table>";
  33.  
  34. ?>
  35.  
  36.    
  37. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement