NYCPHP Meetup

NYPHP.org

[nycphp-talk] How to pass array when click on "submit" ?

Artur Marnik artur at marnik.net
Tue Jan 27 11:51:19 EST 2009


or you can just use:
<input name="name[1]" type="text" />
<input name="zip[1]" type="text" />
....
<input name="name[2]" type="text" />
<input name="zip[2]" type="text" />
....
<input name="name[3]" type="text" />
<input name="zip[3]" type="text" />

then you will get an array after the post

Artur



David Mintz wrote:
> 
> 
> 
> 
>         How to program php script to pass all these above
>         information?"name","position","city","state" and "zip" are all
>         array.
>          
>         Thanks!
>          
>         chad
>          
> 
> 
> If city, state etc are all scalars, why do you want an array at all? And 
> if you do want some or all of the form data wrapped into an array, you 
> might want to use notation like
> 
> <input name="person[name]" type="text" />
> <input name="person[zip]" type="text" />
> 
> -- 
> David Mintz
> http://davidmintz.org/
> 
> The subtle source is clear and bright
> The tributary streams flow through the darkness
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> New York PHP User Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> http://www.nyphp.org/show_participation.php



More information about the talk mailing list