gpt4 book ai didi

php - 如何通过表单上的提交按钮传递参数

转载 作者:可可西里 更新时间:2023-10-31 23:57:13 25 4
gpt4 key购买 nike

我想在 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com