数据库里查询出来的数据循环放到表单里面,如何传递到下个页面? 数据库里查询出来的数据循环放到表单里面,如何传递到下个页面? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果出现多个表单,给每个表单加个区别。比如 from1, from2........... 不好意思。我是一个表单里面有多个条记录。然后传里面的某一条。<form >do{<td style="padding:5px;"><?php echo $result[Productname];?></td><td style="padding:5px;"> <?php echo $result[price];?></td>}</form>这种情形该如何传递。 给循环遍历的一项加一个链接,传到到需要的页面。<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;"> <?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]; 接收 表单?POST给下一个页面就行了! 可以这样:onsubmit="form1.action={URL}"; 我现在想这样处理:页面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]; 但这里接受不到对应控件的值 你的意思是不是,先在一个页面获取数据库的数据,然后再放到另个页面去, 关键是想避免在查询一遍数据库?如果是这样的,我觉得可以在每列后面加个<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()就行啦... 把所有取出来的结果,放入json或xml,然后生成临时文件把这些内容写入进去之后不管你在哪一页都能读取显示了. <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过去的值... 请问怎么把txt文件导入到mysql里面 preg_replace()函数的replace参数部分怎么理解呀 在php中通过连接访问一个目录,可能是随便一个文件名,可以不用扩展名 php文件之间如何传递参数 如何去掉提交文本中多余的空行? apache 支持 php 匹配URL的正则有点问题,帮忙看看~ PHP如何删除文本文件中的一行? 如何使用数组函数:array_search()? 在php不同页面传递参数后,既不报错也不实现页面跳转,求解惑 高分求这样的数组为什么循环输出不对,smarty模版 连接数据库报错
<form >
do{<td style="padding:5px;"><?php echo $result[Productname];?></td>
<td style="padding:5px;"> <?php echo $result[price];?></td>
}</form>
这种情形该如何传递。
<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;"> <?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]; 接收
页面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];
但这里接受不到对应控件的值
如果是这样的,我觉得可以在
每列后面加个<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()就行啦...
之后不管你在哪一页都能读取显示了.
<td style="padding:5px;"><input type="text" name="productname" value="<?php echo $result[Productname];?>"></td>
</form>
然后在yoururl.php接收表单post过去的值...