For one, why are you redefining the array 3 times in that script? ...
I'm trying to follow here... and its not making sense.
-Original Message-
From: Larry Linthicum [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 05, 2001 12:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] array from html form
Hi
I'm just a PHP hobbiest trying to build a points calculating system
for another hobby, please bear with me.
I need to build a multidimensional array from a html form,
the array would look like:
$needed_data = array (
array (id = $member_id,
points = $position ),
array ( id = $member_id,
points =$position),
array (id=$member_id,
points = $position);
$member_id will be used to dynamically build the html form, $position
will be an integer entered into a text field in that form similar to
this:
Fred($member_id=?) .. [ enter position=? ]
John)$member_id=?) ..[enter position=?]
etc
etc
[SUBMIT]
IF ( I can get the data into an array like above) {
I can make the rest of the script work }
but that is a big if G ... how can I stucture the form and get
that multidimen array from the single name/value pairs passed from an
html form?
OR
Maybe I can make a normal array work?
I know that enclosing form field names in [] makes them available as an
array
if the form were dynamically built like
PERSONS NAME (from database via $member_id )
input type = hidden name = [data] value = $member_id input type =
text name = [data] next PERSONS NAME (from database via $member_id )
input type = hidden name = [data] value = $member_id input type =
text name = [data] next PERSONS NAME (from database via $member_id )
input type = hidden name = [data] value = $member_id input type =
text name = [data] etc etc
I think I would then send an array containing all the $member_id (s)
and all the entries into the txt fields
first... am I correct in that?
second ... is the indexing order known and guaranteed? in other words
is
$data[0] and $data[1] OR $data[12] and $data[13]
ALWAYS going to represent a matched pair? ( from one line of the
form } or is the indexing of the array subject to variation and may NOT
be in the same order as the [data] fields in the html ?
What if nothing is entered into the txt field?I know that enclosing form
field names in [] makes them available as an array
if the form were dynamically built like
PERSONS NAME (from database via $member_id )
input type = hidden name = [data] value = $member_id input type =
text name = [data] next PERSONS NAME (from database via $member_id )
input type = hidden name = [data] value = $member_id input type =
text name = [data] next PERSONS NAME (from database via $member_id )
input type = hidden name = [data] value = $member_id input type =
text name = [data] etc etc
I think I would then send an array containing all the $member_id (s)
and all the entries into the txt fields
first... am I correct in that?
second ... is the indexing order known and guaranteed? in other words
is
$data[0] and $data[1] OR $data[12] and $data[13]
ALWAYS going to represent a matched pair? ( from one line of the
form } or is the indexing of the array subject to variation and may NOT
be in the same order as the [data] fields in the html ?
What if nothing is entered into the txt field?
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]