dtgsl60240 2014-02-06 15:11
浏览 105
已采纳

如何在php的select选项中添加复选框?

I make a php page i want to attach check box with list box option value how i attached checkbox,here is my code:

<select name="recepients[]" multiple size="10" multiple="multiple" >
     <?
        //echo $eventid=$_POST['events'];
        $count=count($_POST['events']);
        for($i=0; $i<$count; $i++){
            $select="select b.first_name,b.last_name from buyers b,registrations r where b.buyer_id=r.buyer_id and r.event_id='".$_POST['events'][$i]."' group by r.buyer_id";
            $res = $GLOBALS ['mysqli']->query ($select) or die ($GLOBALS ['mysqli']->error . __LINE__);
            if ($res->num_rows > 0)
            {           
                while($row = $res->fetch_assoc ())
                {
                ?>
                <input type="checkbox" name="receptionts[]" checked="checked"/> 
                <option value="<?=$row['first_name']?>"><?=$row['last_name']?></option>
                <?
                }
            }
        }
        ?>
 </select>
  • 写回答

2条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥50 关于github项目下载运行
      • ¥15 苹果手机删除了qq软件,qq文件怎么恢复
      • ¥20 用mips 人力编程排序问题(能在mars按要求运行)
      • ¥15 Verilog小型神经网络(单层反馈神经网络)
      • ¥15 设计一个数字钟,实现时分秒的显示
      • ¥15 Clion使用头文件链接两个cpp
      • ¥15 51单片机无法触发外部中断问题
      • ¥15 基于半监督,无监督的调制识别
      • ¥15 cst求 阵列 rcs 时候 频域 时域求解器 应该怎样设置 才让两者 计算结果 相似 请附图
      • ¥15 关于#51单片机#的问题:大家帮我看一下为什么我的计时器数字一直不稳定