2014-04-01 67 views
0

实际上,我的表单出现小问题。它不发送单选按钮值。任何人都可以帮助我吗?谢谢..这是我的代码表单不发送单选按钮值

<form action="php/editmain.php" method="post"> 
          <td> 
          <input type="textbox" name="title" placeholder="<?php echo $result_poi['Title'];?>"> 
          <input type="hidden" name="mainid" value="<?php echo $id;?>"> 
          </td> 
          <td> 
           <li><input type="radio" name="icons" value="fa fa-bolt"><img src="icons/acc.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-bars"><img src="icons/apartment.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-glass"><img src="icons/bars.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-book"><img src="icons/books.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-camera"><img src="icons/camera.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-globe"><img src="icons/earth.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-music"><img src="icons/entertain.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-building-o"><img src="icons/estate.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-plus-square"><img src="icons/health.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-hospital-o"><img src="icons/hospital.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-gittip"><img src="icons/massage.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-medkit"><img src="icons/medicalspas.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-home"><img src="icons/museums.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-picture-o"><img src="icons/parks.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-map-marker"><img src="icons/places.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-leaf"><img src="icons/playgrounds.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-circle-o"><img src="icons/playgrounds2.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-cogs"><img src="icons/recreation.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-road"><img src="icons/road.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-shopping-cart"><img src="icons/shopping.png" height="18px" width="18px"></img></li></br> 
           <li><input type="radio" name="icons" value="fa fa-flag"><img src="icons/sports.png" height="18px" width="18px"></img></li></br> 
          </td> 
          <td class="center"> 
          <input type="submit" class="btn btn-info" value="Update"> 


          </td> 
    </form> 
+0

请显示你的'php/editmain.php'文件。 – user2094178

回答

0

我在这里测试了你的代码,没有看到任何错误,html正在发送数据。也许接收数据的代码存在问题。

// editmain.php 
<?php 
    if (isset($_POST['icons'])) { // Checks if the parameter exists. 
     $icons = $_POST['icons']; // Stores parameter in a variable. 
     echo $icons; // Print the selected radio value. 
    } 
?> 
+0

我越来越 注意:未定义的索引:第6行的C:\ xampp \ htdocs \ DIRECTORY \ masterzone \ php \ editmain.php中的图标 – Shubhum

+0

您是否尝试过使用我发送的PHP代码? –

+0

是的,当我把你的代码显然没有提交单选按钮值时,没有任何显示。它可能是我的CSS影响它? – Shubhum

0

我看你有你的html中的变量,这些变量是否设置?

<input type="textbox" name="title" placeholder="<?php echo $result_poi['Title'];?>"> 
<input type="hidden" name="mainid" value="<?php echo $id;?>"> 

$ result_poi和$ id是否设置?