PHP
cliff at cliffmeyers.com
cliff at cliffmeyers.com
Fri Aug 22 00:42:06 EDT 2003
Hi Robert,
I'm a little confused by exactly what you mean, so a URL might help.
If you're passing one form (with several smaller forms inside of it, duplicated,
with the same fieldnames) you may be able to access the multiple values if you
name the fieldnames like this:
name="fieldname1[]"
PHP has a strange behavior where it will only interpret multiple checkbox fields
as an array if you named like a PHP array (see above). You might be able to do
something similar with text fields if you follow that kind of naming convention.
Now, if you're talking about actually passing a PHP array via a form, there is a
way to do that. You can use the serialize() and unserialize() functions to take
something like an array or an object, serialize it (write it to a string), pass
it in the form, and then unserialize it back into a variable on the following
page. If your PHP installation has it enabled, you can also use WDDX as the
serialization method.
Let me know if you need any other info.
-Cliff
On Thu, 21 Aug 2003 22:51:41 -0400 (EDT), Robert Dege wrote:
>
>
> Okay, I know there's been a lot of buzz with php as of late, so maybe
> someone can help me out here.
>
> I'm trying to pass a 2-dimensional array between 2 webpages.
>
> The first page consists of a form with 6 fields. The webpage contains
> several instances of the same form so that the user can fill out
> multiple entries at once.
>
> When the 'Submit' button is clicked, the array is passed to the next
> webpage via $_POST. However, I'm having some trouble extrapolating the
> data from the array. The data appears to be parsed by column instead of
> by row.
>
> I can provide a URL if anyone is interested. I've set it up so that the
> 2nd webpage outputs a 6x6 array so that it's easier to visualize the
> matrix.
>
> Dege
>
> So Many Things in Life Would Be Really Funny
> .... If They Weren't Happening To Me
More information about the nflug
mailing list