dongxuan1660 2015-06-24 12:29 采纳率: 100%
浏览 47

php填充数据未通过表单传输

i m working on a php page data is getting retrieved from database and everything is working fine except that the retrieved data is not getting passed along the form but all others does. only the data i select in the sql drop down box is not saving.

<html>
<head>  
<?php
include('connection.php');
$options = '';
$filter=mysql_query("select distinct username from user");
while($row = mysql_fetch_array($filter)) {
$options .="<option value=".$row['username'].">" . $row['username'] .     "</option>";
}

$menu="<form>
<select>
  " . $options . "
</select>
 </form>";
 ? >


 <title>Bug Report</title>
</head>
<body>
<form  action="bugprocess.php" method="get">
<table width="274" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td width="95"><div align="right">name:</div></td>
<td width="171"><input type="text" name="name" /></td>
</tr>
<tr>
<td><div align="right">description:</div></td>
<td><input type="text" name="description" /></td>
</tr>
<tr>
<td><div align="right">priority:</div></td>
<td><select name="priority"><option value="high">high</option>
<option value="low">low</option>
<option value="medium">medium</option>
</select></td>
</tr>
<tr>
<td><div align="right">assign:</div> </td> <td><name="assign"><?php echo $menu?></td>

<td><div align="right"></div></td>
</table>
<br /><center><input name="submit" type="submit" value="Submit" /></td>

</form>

thank you

  • 写回答

2条回答 默认 最新

  • donglian3061 2015-06-24 12:32
    关注

    your select does not have a "name" attribute , also remove additional form tag from $menu. I have corrected the code for you(shown below). the name of select input is "assign"

    
        $menu="
        <select name="assign">
          " . $options . "
        </select>";
    
    
    评论

报告相同问题?

悬赏问题

  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)