RE: [PHP] Forms and Arrays
From: Mike Ford (M.Ford_at_lmu.ac.uk)
Date: 11/28/03
- Next message: Ivone Uribe: "php as cgi script"
- Previous message: Dave Carrera: "RE: [PHP] Forms and Arrays"
- Maybe in reply to: Mike Ford: "RE: [PHP] Forms and Arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: 'Dave Carrera' <dave@ephgroup.com>, "'Ford, Mike [LSS]'" <M.Ford@lmu.ac.uk> Date: Fri, 28 Nov 2003 17:31:23 -0000
On 28 November 2003 17:22, Dave Carrera wrote:
> Thank you for clearing up my rather lame explanation.
>
> So how can I process $_POST[dynamic-name][user-entered-value]
> arrays to give
> me my desired output:
>
> fname0 = value flab0 = value fplc0 = value
> fname1 = value flab1 = value fplc1 = value
> fname2 = value flab2 = value fplc2 = value
>
> Any help our example will be most appreciated.
Well, like I say, you've pretty much written it there. You need a loop which outputs one line on each iteration -- the body of the loop will look something like:
echo "fname$i = {$_POST['fname'][$i]}"
. " flab$i = {$_POST['flab'][$i]}"
. " fplc$i = {$_POST['fplc'][$i]}"
There's any number of ways you could write the loop so that $i has the approriate value on each iteration, but a for() loop would probably be the conventional one.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
- Next message: Ivone Uribe: "php as cgi script"
- Previous message: Dave Carrera: "RE: [PHP] Forms and Arrays"
- Maybe in reply to: Mike Ford: "RE: [PHP] Forms and Arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|