RE: [PHP] Retrieve values from checkboxes

From: Date: Mon, 24 Mar 2003 20:15:21 +0000
Subject: RE: [PHP] Retrieve values from checkboxes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-140886@lists.php.net to get a copy of this message
On 24-Mar-2003 shaun wrote: > Hi, > > I have some checkboxes on my form and am using the following code to > populate it. The box will be checked if the user is allocated to the > project. My problem is if I uncheck a checkbox and send the form I don't > know what the $project_id is as it returns zero, so I cant delete the > corresponding record, is there a way around this? > > <code snip> One possible way : prior to processing your submit, query the database and build an array of $cur_project['project_id']. Then as you loop on the $_POST['project_id'] unset then corresponding $cur_project[]. Whatever's leftover --those are the project_ids to remove. Regards, -- Don Read dread@texas.net -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. (53kr33t w0rdz: sql table query)

« previous php.general (#140886) next »