Hello
Please, I try to use inputted number for further code. I am using form input and superglobals but I do nto see the mistake, althought tried using many variations. >:( Can someone help? Many thanks in advance!.
<form id="frm1" action="myform.php" method="post">
Input number of the rows: <input type="text" value=" " name="m">
</form>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// collect value of input field
$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>";
?>