Re: [PHP] web form data to arrays?

2007-01-17 Thread Jim Lucas
William Stokes wrote: Hello, I have a script which retrieves rows from DB and prints them to a user editable form to a web page. I don't know how to print the form objects so that all editable fields are put to arrays for updating them to DB. I have tried to create arrays sarjanID[] etc. but

Re: [PHP] web form data to arrays?

2007-01-17 Thread William Stokes
I got it working like this: $counter = 0; foreach ($arr as $value) { //make the form ... print "\n"; $counter++; } Now I have array $ArrUpdate which contains sub-arrays with the update data. This can now be processed with another foreach loop -Will "Jochem Maas" <[EMAIL PROTECTED]> kirj

Re: [PHP] web form data to arrays?

2007-01-17 Thread Jochem Maas
Németh Zoltán wrote: > And how does it work? does it create a sub-array of $_POST? test it and find out: echo ''; var_dump($_POST); echo ''; > And is it documented somewhere in the manual? more than likely. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.ph

Re: [PHP] web form data to arrays?

2007-01-17 Thread Mike Smith
Sorry about that...yes it creates an array so... would create an array accessible from $_POST['names'] foreach($_POST['names'] AS $name){ echo $name; } ...produces: LarryCurlyMoe On 1/17/07, Németh Zoltán <[EMAIL PROTECTED]> wrote: And how does it work? does it create a sub-array of $_PO

Re: [PHP] web form data to arrays?

2007-01-17 Thread Németh Zoltán
And how does it work? does it create a sub-array of $_POST? And is it documented somewhere in the manual? Greets Zoltán Németh On sze, 2007-01-17 at 10:54 -0500, Mike Smith wrote: > > > *note the []. > > -- > Mike > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: h

Re: [PHP] web form data to arrays?

2007-01-17 Thread Mike Smith
*note the []. -- Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] web form data to arrays?

2007-01-17 Thread Németh Zoltán
On sze, 2007-01-17 at 16:13 +0200, William Stokes wrote: > But if the form is printed with foreach don't I need some type of counter? > Otherwise the form that is posted will contain only the data of the last > iteration of the loop that wrote the original form. right? > > -Will > so you want

Re: [PHP] web form data to arrays?

2007-01-17 Thread William Stokes
But if the form is printed with foreach don't I need some type of counter? Otherwise the form that is posted will contain only the data of the last iteration of the loop that wrote the original form. right? -Will ""Németh Zoltán"" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED] > On

Re: [PHP] web form data to arrays?

2007-01-17 Thread Németh Zoltán
On sze, 2007-01-17 at 15:23 +0200, William Stokes wrote: > Hello, > > I have a script which retrieves rows from DB and prints them to a user > editable form to a web page. I don't know how to print the form objects so > that all editable fields are put to arrays for updating them to DB. I have

[PHP] web form data to arrays?

2007-01-17 Thread William Stokes
Hello, I have a script which retrieves rows from DB and prints them to a user editable form to a web page. I don't know how to print the form objects so that all editable fields are put to arrays for updating them to DB. I have tried to create arrays sarjanID[] etc. but havent got it to work...