RE: [PHP] Passing associative arrays between forms
| From: | Dana dot Reed at clinicaldatacare dot com | Date: | Fri, 18 Aug 2000 10:22:52 +0000 |
| Subject: | RE: [PHP] Passing associative arrays between forms | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-12431@lists.php.net to get a copy of this message | ||
Jay
This might help a bit. And we're still using PHP3 so that shouldn't be an issue.
I have a form with a multiple select box that passes values to another form for confirmation. This
form then sends the values as hidden variables to a DB update script using the following loop:
for ($i=0; $list1[$i]; $i++) {
echo "<INPUT TYPE=hidden NAME=list1[$i] VALUE=$list1[$i]>\n";
}
On the receiving end you can then use a similar approach to rebuild the array, if so desired.
med vänlig hälsning
/Dana
-----Original Message-----
From: ct@arborinternet.com [SMTP:ct@arborinternet.com]
Sent: Friday, August 18, 2000 9:56 AM
To: jay.paulson@viatel.com; php-general@lists.php.net
Subject: RE: [PHP] Passing associative arrays between forms
I am not sure how the implode() and explode() would help. Just keep them as
arrays. Try something like:
<input type=text name="array[element]" value="<?php echo
$array['element'];
?>">
This may only work in PHP4.
> -----Original Message-----
> From: Paulson, Joseph V. "Jay" [mailto:jay.paulson@viatel.com]
> Sent: Thursday, August 17, 2000 2:11 PM
> To: php-general@lists.php.net
> Subject: [PHP] Passing associative arrays between forms
>
>
> Hey everyone--
>
> I have a multiple page form (it's three pages long) and I am
> trying to pass
> an array between each form using the implode() and explode() functions.
> However, I would like to keep the associative properties of the array I
> create and not have to keep track of what position [0],
> [1],...[99] are. Is
> there any other way to pass array's between forms besides using the
> implode() and explode() functions?
>
> I've already tried cookies but I have too many values for the browser to
> handle (I have over 20 variables to pass between each form). Therefore,
> cookies won't work.
>
> Any how, any help would be much appreciated!!! :)
>
> Thanks in advance...
> Jay Paulson