Forum Moderators: coopster
Just wondering if there´s any way to post a number of checkboxes values as an array?
i.e
while ($customer = mysql_fetch_array($result, MYSQL_BOTH))
{
echo "<INPUT TYPE='CHECKBOX' NAME='ALTERTHIS' VALUE='".$customer[0]."'><BR>";
}
Will create a list of checkboxes with same NAME, but different VALUES that it gets from database. Problem is it seems to reset the VALUE of NAME in each loop, instead of creating an ARRAY of "ALTERTHIS" values that I need to access..
I could give each checkbox an uniqe name, but I never know which ones will be set or what values to alter in the database in next page..
Hope you understand what I mean?
echo "<FORM METHOD='POST' ACTION='submitted.php'>";
while ($kunder = mysql_fetch_array($result, MYSQL_BOTH)) {
echo "<TR ALIGN='CENTER' BGCOLOR='black'>";
echo "<TD BGCOLOR='BLACK'>";
echo $kunder[1];
echo "</TD>";
echo "<TD BGCOLOR='#B0C4DE' WIDTH='70%'>";
echo "<A HREF='index.php?page=se_kund&kundid=".$kunder[0]."'>",$kunder[2],"</A>";
echo "</TD><TD>";
echo $kunder[3];
echo "</TD><TD>";
echo $kunder[13];
echo "</TD>";
echo "<TD>";
echo "<INPUT TYPE='CHECKBOX' NAME='alter[]' VALUE='".$kunder[0]."'>";
echo "</TD></TR>";
}
echo "<INPUT TYPE='SUBMIT' VALUE='OK'></FORM>";