This is a security "principle" question...
This form includes a hidden field, which gets included in the POST request, and tells the server-side code which row in the database table to update (assuming all the fields have been properly validated)
<form method="post" name="update">
<p><input name="table_row_index" type="hidden" value="102" /></p>
<p><input name="Name" type="text" value="Adam Black" /></p>
<p><input name="Submit" type="button" value="Submit" /></p>
</form>
Couldn't someone edit the HTML and change the "table_row_index" value to a valid number and thus overwrite a row they shouldn't have access to?
So, my questions really are...
- Should you use the table index in the form as the row id?
- If not, how would you tell the PHP which row to update? (please assume the form is not page specific... the contents are updated as per a user action).