RE: [PHP-DB] Urgent help needed
| From: | USA) | Date: | Tue, 21 Oct 2003 22:50:51 +0000 |
| Subject: | RE: [PHP-DB] Urgent help needed | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-31244@lists.php.net to get a copy of this message | ||
Or you could hire John or me to do it for you. :-) Just kidding. I used the delimiting solution all
over the place it is pretty simple.
<>< Ryan
-----Original Message-----
From: John W. Holmes [mailto:holmes072000@charter.net]
Sent: Tuesday, October 21, 2003 4:42 PM
To: Chris Payne
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Urgent help needed
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php