获取单选框的值:<?
echo $_POST['radio1'];
?>
<html>
<head></head>
<body>
<form name="form1" method="POST">
<input type="radio" name="radio1" id="radio1" value="1">1
<input type="radio" name="radio1" id="radio1" value="2">2
<input type="submit">
</form>

</body>
</html>

解决方案 »

  1.   


    <?
    print_r($_POST['checkbox1']);
    ?>
    <html>
    <head></head>
    <body>
    <form name="form1" method="POST">
    <input type="checkbox" name="checkbox1[]" id="checkbox1[]" value="1">1
    <input type="checkbox" name="checkbox1[]" id="checkbox1[]" value="2">2
    <input type="checkbox" name="checkbox1[]" id="checkbox1[]" value="3">3
    <input type="checkbox" name="checkbox1[]" id="checkbox1[]" value="4">4
    <input type="submit">
    </form>

    </body>
    </html>
      

  2.   

    我的只有一个checkbox,其他的是随数据显示出来的,那要怎么做?
      $ch=array();
    $ch=$_POST['checkbox'];
    for($i=1;$i<=$ch.length();$i++)

    {


    }
    if($_POST['s_survey']="ATAT"){
             $query="insert into v_survey_22786(id,submitdate,startlanguage,token,22786X1X1,22786X1X2,22786X1X3,22786X1X5)values(?,?,?,?,?,?,?,?) where id = ";
            }
            elseif ($_POST['s_survey']="ATAT2"){
             $query="insert into v_survey_74412(id,submitdate,startlanguage,token,74412X2X4)";
            }
           elseif($_POST['s_survey']="service survey"){
            $query="insert into v_survey_83314(id,submitdate,startlanguage,token,83314X3X13,83314X3X6,83314X3X8,83314X3X7,83314X3X9,83314X3X10,83314X3X11,83314X3X12)values(?,?,?,?,?,?,?,?,?,?,?,?)";
           }
      

  3.   

    你的问题不是php的问题,是客户端的问题。你用checkbox,提交后接受post变量就可以判断哪个被选择了。
      

  4.   

    用php将数据浏览页按5楼的格式生成就行了