我想在 PHP 制作的 mySQL 中创建可以更改产品数据的 from。
我有自动递增并指定每个产品的键列。
当我点击编辑产品链接时,它会传递我从每个产品获得的关键值
并链接到 editPage.php
$Key = $data['Key'];
<a href=\"editPage.php?Key=".$Key."\">edit</a>
在 editPage.php 中,我从上一页获取键值,我想通过提交表单按钮将此值传递到下一页。我在操作链接中附加键值。
<?$Key = $_GET["Key"];?>
<form id="form2" name="form1" method="post" action="editWeb.php?Key=".$Key." \">
它不起作用,我可以用其他方式传递键值吗?如果您想了解更多信息,请告诉我 谢谢!!:))
最佳答案
您需要回显该值。
<form id="form2" name="form1" method="post" action="editWeb.php?Key=<? echo $Key ?>"/>
你也可以使用隐藏输入:
<form id="form2" name="form1" method="post" action="editWeb.php"/>
<input type="hidden" name="Key" value="<? echo $Key ?>" />
关于php - 如何通过表单上的提交按钮传递参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13492699/