Re: Urgent help needed

From: Date: Tue, 21 Oct 2003 22:41:59 +0000
Subject: Re: Urgent help needed
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-31242@lists.php.net to get a copy of this message
Chris Payne wrote:
Basically, aswell as sending the ID, I need to send the title and path too and i'm abit confused. <input type="checkbox" name="del[]" value="<?=$id?>">
You could pass the value as "id/title/path" where / is a delimiter, then pull it apart on the other side. Or, you could format 3 different elements like this: <input type="checkbox" name="del[<?=$id?>]" value="<?=$id?>"> <input type="hidden" name="title[<?=$id?>]" value="<?=$title?>"> <input type="hidden" name="path[<?=$id?>]" value="<?=$path?>"> Now, when a checkbox is checked, you'll end up with something like $del[1234]. Just pull the key or value and then you'll be able to determine $title[1234] and $path[1234] to use in your script. foreach($del as $id) { echo "Deleting id: $id, title: {$title[$id]}, path: {$path[$id]}"; } -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.db (#31242) next »