processing form with unknown number of checkboxes, each with a unknown name.

From: Date: Sun, 02 Feb 2003 12:28:03 +0000
Subject: processing form with unknown number of checkboxes, each with a unknown name.
Groups: php.general 
Request: Send a blank email to php-general+get-133987@lists.php.net to get a copy of this message
Hi, I building a form which will be used to set access rights to different parts of my web album. When editing the settings for each album, like the albums name and wether or not everyone should be allowed to upload pictures to it, I also present a list of checkboxes to the administrators. One checkbox for each registred user. If checked, to user is allowed to view the pictures, if not check, no pictures show. The checkbox part of the form I build uses this code: db_connect($dbuser, $dbpassword, $dbdatabase); $query = "SELECT userid FROM members"; $result = mysql_query($query); while($row = mysql_fetch_array($result)) { echo($row[0]); ?> <INPUT TYPE="checkbox" name="<?php echo($row[0])?>" VALUE="YES"> But how do I process this form when saving the settings for the album? For the forms I've built so far, I've known what information I can find in $_REQUEST['']. But this time, I don't know how many checkboxes there are, and what their names will be. How do I do this? Is the form ok, or is a bad form design the reason I can't figure out what to form processing code should be? -- anders thoresson

« previous php.general (#133987) next »