Re: Urgent help needed
| From: | Rolf Brusletto | Date: | Tue, 21 Oct 2003 23:45:51 +0000 |
| Subject: | Re: Urgent help needed | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-31243@lists.php.net to get a copy of this message | ||
Chris - it might take a little work, but I think I have a good solution for ya. I would maybe use the $id as the key, and then use hidden inputs to set the other stuff in a multidimensional array..... like so
<input type="checkbox" name="del[<?=$id?>][path]" value="<?=$path?>">
<input type="hidden" name="del[<?=$id?>][title]" value="<?=$title>">
then, on the flip side of the script when you need the data, the array keys are the actual id's you need, and the multidimensional array has keys of [path] and [title] like below
$del[1][path] == '/home/monkey';
$del[1][title] == 'monkeystuff';
$del[2][path] == 'home/donkey/';
$del[2][title] == 'donkeystuff';
you can access this array by doing the following...
foreach($del as $id => $slot) {
echo $id.'<br />';
echo 'path = '.$slot[path].'<br />';
echo 'title = '.$slot[title].'<br />';
}
Hope this helps...
Rolf Brusletto
phpExamples.net
http://www.phpExamples.net
Chris Payne wrote:
Hi there everyone, I have this system where you can create folders on your HD for inserting PDF files via a web interface and you can also remove these folders, this works no problem, but I have run into a snag, I need to send more than 1 field in the below array via a form, how can I do? 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?>"> Any help would be VERY appreciated :-) Thanks everyone. Chris