RE: [PHP] passing checkbox info

From: Date: Wed, 21 Aug 2002 04:10:23 +0000
Subject: RE: [PHP] passing checkbox info
Groups: php.general 
Request: Send a blank email to php-general+get-113405@lists.php.net to get a copy of this message
<input type = "checkbox" name = "cbox[<?= $row[xxx]; ?>]" value = "yes"> replace "xxx" with the row number for your id field when it gets to php, the index of $cbox will be the id from the database, just use: foreach ($cbox as $id=>$dummy) to loop through the array HTH Martin -----Original Message----- From: Brian & Shannon Windsor [mailto:bwindsor@mindspring.com] Sent: Wednesday, August 21, 2002 2:00 PM To: php-general@lists.php.net Subject: [PHP] passing checkbox info I'm trying to use checkboxes to be able to delete information from my database. It's just not working right. I can't get the checkbox form to pass a variable that makes any sense to me, and I looked into the check box function, and it made less sense. The value passed back from the check boxes are always "yes", but there is nothing to tell which box passed it back. Maybe I don't know enough about the check boxes in general. Any help is appreciated. I'm displaying the checkboxes as I display the data from the database. Can I tie in the checkboxes to one of the fields that i could then use to delete that entry? Thanks, Brian while ($row = mysql_fetch_row($result)) { echo "<tr align=left>\n"; { ?> <td> <input type = "checkbox" name = "cbox[]" value = "yes"> <?php echo "<td>"; echo "<a href='$row[0]'><img src='$row[0]' width='80' height='50' border='0'>"; echo "<td>"; echo $row[1]; echo "<td>"; echo $row[2]; echo "<td>"; echo $row[3]; echo "<td>"; echo $row[4]; echo "<td>"; echo $row[5]; echo "<td>"; echo $row[6]; echo "<td>"; echo $row[7]; echo "<td>"; echo $row[8]; echo "</td>\n"; } echo "</tr>\n"; } echo "</table>"; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#113405) next »