I'm trying to make a matrix builder in php. I have got it to work so that a user can specify how many rows and columns in the matrix, and then use that information in the next page to come up with a table, with inputs for each number place in the matrix.
The trouble I am having is showing the matrix that the user just input.
This is the code:
Code: Select all
<?php
$rows = $_GET['rows'];
$columns = $_GET['columns'];
$i = 1;
$j = 1;
$n = 1;
$k = 1;
while ($k < ($rows + 1)) {
echo "<tr>";
while ($n < ($columns + 1)) {
echo "<td>";
echo $_POST['r'.$i.'c'.$j];
$j++;
$n++;
}
$n = 1;
$i++;
$k++;
}
?>Code: Select all
$_POST['r'.$i.'c'.$j];If theres any more information you need from me, let me know.