Using php I am generating a table from a PostgreSQL system. The user needs to be able to have the option to delete a row in the table, so I have created a "Delete?" button option in the last column of the table.
The button looks like this:
echo '<td> <input type="submit" name="'.$row['language'].'" value="Delete?" class="odd" />';
So the button gets a name attribute with the language of that row.
I have two issues: 1. Most importantly, I am not sure how to access this field. Initially I was thinking I could get it via POST e.g name = _$POST['name'], but I need the 'language' field to get the specific button corresponding to the row. Hopefully you understood that... To clarify, the html attribute name is not generated until the query has been printed out. And then I'd need to know the name attribute to access it in the delete.php.
- Even if I can get the name of the language to be deleted from the button, it is possible that there may be other languages of the same name in the database with other attributes, and so I would not want those deleted when I do a delete statement, meaning I need more information from that specific row of the table. So how would I pass more information?
I've been considering hidden fields, but I'm unsure how I'd generate all the info and then how it'd be passed to my delete.php file.
If you have any other suggestions too though I'd be open to them.