我认为这个问题已被问过几次,我也在谷歌上找到了一些问题.
但是我并不想改变整个表单行为.我只需要部分改变它.
这就是我的意思:
我有以下表格:
<form action="order.php?add=<?php echo $product_name; ?>&price=<?php echo $price; ?>&qty=1" method="post">
<input type="text" name="qty" id="qty" class="qty" size="12" />
<input type="submit" class="button2" name="buttonadd" id="button" value="Add to cart" />
</form>
Run Code Online (Sandbox Code Playgroud)
我需要做的是改变qty=1表单动作,以便反映<input type="text" name="qty" id="qty" class="qty" size="12" />价值!
我怎样才能做到这一点?
我真的不明白为什么这个简单的任务必须如此复杂.我正在尝试更新mysql数据库,无论我做什么,它都不会更新它!
我也一直收到此通知消息.
Notice: Undefined index: thisID in
Run Code Online (Sandbox Code Playgroud)
基本上我正确地在字段中回显所有值,但是当我按下提交按钮时我无法更新mysql,我得到上面的错误!
我从listing.php解析信息/数据
<?php
// This block grabs the whole list for viewing
$product_list = "";
$sql = "SELECT * FROM products ORDER BY date_added DESC";
$query = mysqli_query($db_conx, $sql);
$productCount = mysqli_num_rows($query); // count the output amount
if ($productCount > 0) {
while($row = mysqli_fetch_array($query, MYSQLI_ASSOC)){
$id = $row["id"];
$product_name = $row["product_name"];
$price = $row["price"];
$quantity = $row["quantity"];
$shipping = $row["shipping"];
$category = $row["category"];
$manufactor = $row["manufactor"];
$special = $row["special"];
$stock = $row["stock"]; …Run Code Online (Sandbox Code Playgroud)