[nycphp-talk] How to pass array when click on "submit" ?
chad qian
nynj.tech at hotmail.com
Tue Jan 27 12:16:39 EST 2009
I am not sure how many "name","position",.."zip".I guess maybe I need foreach.How to program foreach here?
Thanks!
chad> Date: Tue, 27 Jan 2009 11:51:19 -0500> From: artur at marnik.net> To: talk at lists.nyphp.org> Subject: Re: [nycphp-talk] How to pass array when click on "submit" ?> > 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> _______________________________________________> New York PHP User Group Community Talk Mailing List> http://lists.nyphp.org/mailman/listinfo/talk> > http://www.nyphp.org/show_participation.php
_________________________________________________________________
Windows Live™: E-mail. Chat. Share. Get more ways to connect.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_allup_explore_012009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20090127/eeab8d14/attachment.html>
More information about the talk
mailing list