Hi there folks:
I have a php function that takes a database result array, and the result's unique 'id' field as arguments, generates as many tables as there are results and displays the data as form-field values (within a single form to enable multiple updates).
The function takes the array's keys and the database's 'id' field to uniquely name each form element: <input type=\"text\" name=\"autogen{$field_id}[$key]\">
The source for the resultant table display in the browser is as follows:
<form method="POST" action="mypage.php">
<table border="0" width="100%" bgcolor="#FFFFFF">
<tr valign="top"><td align="left"><p><b>name</b></p></td>
<td align="right">
<input type="text" name="autogen49[name]" size="12" value="Some value">
</td></tr><tr valign="top"><td align="left"><p><b>description</b></p></td>
<td align="right">
<textarea name="autogen49[description]" rows="4" cols="25">Some text is displayes here</textarea>
</td>
</tr>
<tr valign="top"><td colspan="2" align="right">
<input type="radio" name="editme[49]" value="edit">delete?<input type="radio" name="editme[49]" value="delete">
</td></tr></table></td>
</tr>
</table>
<!-- more tables go here dependant upon number of database query results (The number '49' is auto-increment field value taken from DB - I've ommitted a bunch of results for clarity -->
</form>
The trouble I have is in accessing the individual values of each form element. No matter what form of loop I employ after the form submission, I get unexpected results and I can NEVER access the value I require, even though I can display it on the page using var_dump($HTTP_POST_VARS);
Can anyone help me out here??? I've been mulling this over since last Thursday!!
Many thanks.
Russ