I must create a code that the user can enter the number of rows and columns a table should have, and this table should appear to the user. I try this code here, but the table does not appear with the rows and columns I typed:
<?php
echo '<form action="Q.php" method="post">Digite o número de linhas: <input type="text" name="linhas"><br>Digite o número de colunas: <input type="text" name="colunas"><br><input type="submit" value="Construir tabela"></form>';
$linhas = $_POST['linhas'];
$colunas = $_POST['colunas'];
$l = 0;
$c = 0;
echo '<table border="1" width="400px" height="300px">';
while($l <= $linhas){
$l++;
echo '<tr>';
while($c <= $colunas){
$c++;
echo '<th></th>';
}
echo '</tr>';
}
?>
Thanks in advance for your response