I need to code a form for user privileges on a forum, the form contains a list of all forum users, so the form may contain 10 users one day but the next may contain 15, so the form will expand. Here is an example of what the form will look like with 4 usernames:
Username - [Drop down list of privileges]
Username - [Drop down list of privileges]
Username - [Drop down list of privileges]
Username - [Drop down list of privileges]
[Submit Button]
I need to be able to identify each dropdown list value with the username they where assigned to once the form has been submitted and then be able to update that usernames privilege in the database.
So if the first username was ‘Fred’ I could name the first drop down list ‘fred’ and then when the form was submitted $fred would equal what ever privilege was assigned to it. My problem is that I don’t know how to link $fred to the username Fred record not with out restricting the form to a set number of usernames, which in this case is not an option.
Does anyone know of an answer I can use without restricting the usernames on the form?
Thanks for any help in advance, this has been racking my brain for 2 weeks 😕