im new here. i have problem and in great hurry :( scenario : i want to make an dynamic input form. user input a number of columns and rows they want. then, it generate the table as the number inputted in previous form. after that, user input a random number to the table, and click submit button. system will record the data and process it. finally, system will show the average (just the example).
table generate succesfully. the problem is how to save/read the data inputted in input form.
this is input.php
<tr>
<td width="30%" align="left" valign="top">Input the number of columns :<td height="37" align="left" valign="top"><input type="text" name="colums" value="" /></td>
</tr>
<tr>
<td align="left" valign="top">Input the number of rows :</td>
<td width="70%" align="left" valign="top"><input type="text" name="rows" value="" /></td>
</tr>
<tr>
<td align="left" valign="top"> </td>
<td align="left" valign="top"><input type="submit" name="button" id="button" value="Submit" /></td>
</tr>
</table>
</form>
and the result php like this..
<?php
$columns = $_POST['columns'];
$rows = $_POST['rows'];
echo "<form method='post' action='process.php'>";
echo "<table>";
//made the rows
for ($i= 0; $i <= $rows-1; $i++){
//and the colums
echo "<tr>";
for ($j = 0; $j <= $colums-1; $j++) {
//here is the input form, and each of data inputed here that i want to save it.
$sum = array('[$i][$j]');
echo "<td> </td>
<td><input size='5' type='text' name='data".$sum."' /></td>
";
}
echo "</tr>";
}
echo "<tr><td></td><td><input type='submit' name='submit' values='Submit' /></td></tr>";
//im not sure here in value='$sum'
echo "<tr><td></td><td><input type='hidden' name='banyak' value='$sum' /></td></tr>";
echo "</table>";
echo "</form>";
// here,which one should i $_GET[''] ?
?>
and the process.php show the average from data. i made it totally wrong in process.php