Checkboxes instead of drop down list in PHP, MySQL
I have this working code below, but i'd like to change it from drop down
list to checkboxes, so multiple options can be selected and passed for
further action instead of just one that the drop down list allows. I'm
fairy new to PHP and have done tons of searching on this without any
success. Any help is much appreciated.
$l = $_POST['LT'];
$pals = '';
$r = mysql_query("SELECT DISTINCT pal_num FROM pl_tab WHERE
lt_num='$l'");
while($row = mysql_fetch_assoc($r))
{
$pals .= '<option>'.$row['pal_num'].'</option>';
}
if($pal == '')
echo '';
else
echo '<form name="get_pal" action="post.php" method="POST">';
echo '<select name="pal_numb"><option>Select
Pal</option>'.$pals.'</select>';
echo '<input type="submit" name="post" value="Go!">';
echo '</form>';
No comments:
Post a Comment