How to process a variable amount of checkboxes with php

ReinnaNib

New Member
My goal is to process an unknown amount of names (between 2 and 8) and format it in a nice way.The amount of names varies per user. So one user will see 4 names, another will see only 2 names.I'll show an example with 3 names.\[code\]<input type="checkbox" name="inuser[]" id="u1" value="http://stackoverflow.com/questions/6499693/Floris" /><label for="u1">Floris</label><input type="checkbox" name="inuser[]" id="u2" value="http://stackoverflow.com/questions/6499693/Rosa" /><label for="u2">Rosa</label><input type="checkbox" name="inuser[]" id="u3" value="http://stackoverflow.com/questions/6499693/Lotte" /><label for="u3">Lotte</label>\[/code\]Say Rosa's checkbox is checked. Than I want to store 'Rosa' in the table.Say Rosa and Floris are checked. Now I want to store 'Floris and Rosa'Say all three are checked. Than I want to store 'Floris, Rosa and Lotte'I'm not that experienced with arrays. So this is an unsolvable problem for me.I've tried to solve it by reading tutorials, but I need someone to help me a bit.Let me try to explain why the amount of names are variable... On the site students will be able to log there school project activities. They work in groups, but the amount of people differ. So every 'project' will have a different amount of students working on it. When they log an activity the students who carried out the activity can be checked and the server should turn this into a string (for example: 'Floris, Rosa and Lotte') and store it in the log table. So later on the server will be able to retrieve the log information (What, When, Who, etc.)Feel free to correct my terrible English. I'm from Holland.
 
Top