Hi, excuse me. Im new here, but i really need help. I can’t find any idea to solve this.
so,i want to save data that i input to the table.
The table itself made from input form, consist row and columns as i order before.
here is code for table input.php
[code=php]
<form id=”form1″ name=”form1″ method=”post” action=”result.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 generate the table. each cell is input form.
[code=php]<?php
$columns = $_POST[‘columns’];
$rows = $_POST[‘rows’];
echo “<form method=’post’ action=’process.php’>”;
echo “<table>”;
//made the columns
for ($i= 0; $i <=$baris-1; $i++){
//and the rows
echo “<tr>”;
for ($j = 0; $j <= $kolom-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, in process.php should show the average the all data, or any other math formula.
i use the single input data in process.php,and its totally wrong :s
sorry for my bad english..