The code below is intended to allow a site administrator to manage users/passwords.
The output is formatted into a table where:
1st row is the [b]Update Records
2nd row is the headers for each column,
3rd row allows Administrator to add a new user/password,
4th+ row lists existing users and their passwords. (Password is put into a textbox to allow changes.) (A checkbox in the first columns is intended to allow the administrator to flag users for deletion.)
The data is sent to [b]updateuser.php
What I am getting is:
If a new UserID and Password are entered, they are received.
I am receiving the Password of the last user in the list.
If one of the checkboxes is on, I am getting ON, but don’t know which row it refers to.
What I am not getting is:
I am not getting the full array of all the checkboxes,
I am not getting the full array of passwords.
[SIZE=3][b]I assume that in my code, I am not creating an array of Checkbox and Text contols. Can someone please advise how to fix this.
Cheers,
Nap
Note that:
$namePassCombos[$i][0] contains the user’s ID
$namePassCombos[$i][1] contains the user’s password.
[code]
echo “<form method=’POST’ action=’updateusers.php’ >”;
echo “<table width=’450′ border=’1′ cellspacing=’0′ cellpadding=’6′>”;
echo “<tr>”;
echo “<td colspan=3><input type=’submit’ name=’submit’ value=’Update Records’></td>”;
echo “</tr>”;
echo “<tr>”;
echo “<td width=’20%’ align=’center’ bgcolor=’coral’ >Delete</td>”;
echo “<td width= ‘40%’ align=’Left’ bgcolor=’coral’ >User ID</td>”;
echo “<td width= ‘40%’ align=’Left’ bgcolor=’coral’ >Password</td>”;
echo “</tr>”;
echo “<tr>”;
echo “<td align=’center’ bgcolor=’aqua’ >New User</td>”;
echo “<td align=’Left’ bgcolor=’aqua’ ><input type=’text’ name=’userid’></td>”;
echo “<td align=’Left’ bgcolor=’aqua’ ><input type=’text’ name=’userpassword’></td>”;
echo “</tr>”;
for ($i=0; $i <= $index; $i++)
{
echo “<tr>”;
echo “<td align=’center’ bgcolor=’beige’ ><input type=’checkbox’ name=’deletemember’ /></td>”;
echo “<td align=’Left’ bgcolor=’beige’ >”.$namePassCombos[$i][0].”</td>”;
echo “<td align=’Left’ bgcolor=’beige’ ><input type=’text’ name=’password’ value=”.$namePassCombos[$i][1].”></td>”;
echo “</tr>”;
}
echo “</table>”;