|
Posted by BKDotCom on 11/22/06 16:39
don't name them the same! :)
if you're going through a loop
$name = $i.'_id';
$name = $i_'first_name';
etc
or, a bit more clever $name = 'user['.$i.'][id];
ie <INPUT name="user[1][id]">
<INPUT name="user[1][first_name]">
<INPUT name="user[1][last_name]">
<INPUT name="user[2][id]">
will create a $_POST var that looks like this when submitted
$_POST = array(
user = array(
1 => array(
'id' => 'whatever',
'first_name' => 'whatever',
'last_name' => 'whatever',
),
2 => array(
'id' => 'whatever',
),
),
);
Auddog wrote:
> I have a form that I'm creating that queries my database for active users,
> puts them in a list and then adds an input box for each line. I'm having
> troubles trying to figure out how I would then input the information from
> the input box into my table when submitted. Each line lists out the id,
> first name, last name from the query, but each input box is named the same.
> How would I change the name of each input box?
>
> Hopefully this makes some sense. Thanks for any help that you can provide.
>
> A
Navigation:
[Reply to this message]
|