数据库里查询出来的数据循环放到表单里面,如何传递到下个页面?

解决方案 »

  1.   

    如果出现多个表单,给每个表单加个区别。比如 from1, from2...........
      

  2.   

    不好意思。我是一个表单里面有多个条记录。然后传里面的某一条。
    <form >
    do{<td style="padding:5px;"><?php echo $result[Productname];?></td>
    <td style="padding:5px;">&nbsp;<?php echo $result[price];?></td>
    }</form>
    这种情形该如何传递。
      

  3.   

    给循环遍历的一项加一个链接,传到到需要的页面。
    <form >
    do{<td style="padding:5px;"><a href=xxx.php?Productname=<?php echo $result[Productname];?>><?php echo $result[Productname];?></a></td>
    <td style="padding:5px;">&nbsp;<?php echo $result[price];?></td>
    }</form>xxx.php 是传递的最终页面
    如果要传递多项用 & 连接
    例如 <a href=xxx.php?Productname=<?php echo $result[Productname];?>&price=<?php echo $result[price];?>> <?php echo $result[Productname];?> </a>
    在最终页面 用
    $Productname=$_GET[Productname];
    $price=$_GET[price];  接收
      

  4.   

    表单?POST给下一个页面就行了!
      

  5.   

    可以这样:onsubmit="form1.action={URL}";
      

  6.   

    我现在想这样处理:
    页面1。php中  do{ <input name="<?=$result1[id]?>" type="text" id="key1" size="6" value="<?php echo $result1[product_num];?>" />   
    <td style="padding:5px;"><a href="edit_chk.php?id=<?php echo $result1[id];?>">确定</a></td>
    }whlie(...)动态添加表单,然后每个控件名都用表中的id字段进行区分,现在问题的是,如果有两行以上记录。我要在表单里面做修改。
    传递到下个页面处理数据里 用post接受
    $a=$_GET[id];
    $a="=$a";
    echo $_POST[$a]; 
    但这里接受不到对应控件的值
      

  7.   

    你的意思是不是,先在一个页面获取数据库的数据,然后再放到另个页面去, 关键是想避免在查询一遍数据库?
    如果是这样的,我觉得可以在
    每列后面加个<input type="hidden" value=""/>放值
    比如:<form action="xxx.xxx" method="post" id="xxxform">
    <td style="padding:5px;"><?php echo $result[Productname];?><input type="hidden" name="<?=$result[Productname]?>" value="<?=$result[Productname]?>"/></td>
    </form>要跳转传值的话,直接javascript:$('#xxxform').submit()就行啦...
      

  8.   

    把所有取出来的结果,放入json或xml,然后生成临时文件把这些内容写入进去
    之后不管你在哪一页都能读取显示了.
      

  9.   

    <form method="post" action="yoururl.php">
    <td style="padding:5px;"><input type="text" name="productname" value="<?php echo $result[Productname];?>"></td>
    </form>
    然后在yoururl.php接收表单post过去的值...