在表格内添加输入表单

时间:2018-10-31 01:44:40

标签: php

因此,在表中tbody之前的位置,我在form内插入了tbody。但是,在提交其表单时,该URL将获得btnchange.php?qty=1而不是btnchange.php?prod_id=cartno

shopcart.php

<?php // start
$stmt = $DB_con->prepare("SELECT * FROM cart WHERE cartuser = '$userid' and cartpend='IN CART'");
   $stmt->execute();

      if($stmt->rowCount() > 0)
      {
        while($row=$stmt->fetch(PDO::FETCH_ASSOC))
        {
        extract($row); //end ?>


<form method="get" action="btnchange.php?prod_id=<?php echo $row['cartno'] ?>">
  <tbody>
    <tr>
      <td><?php echo $row['cartno']; ?></td>
      <td><?php echo $row['cartname']; ?></td>
      <td><?php echo $row['cartprice']; ?></td>
      <td><input type="text" name="qty" value="<?php echo $row['cartqty']; ?>"></td>
      <td><?php echo $row['cartsub']; ?></td>
      <td><span class="label label-primary"><?php echo $row['cartpend']; ?></span></td>
      <td><button type="submit" name="submit">Submit Quantity</button></b>
      <td><a class="btn btn-danger btn-xs" href="?delete_id=<?php echo $row['cartno']; ?>" title="click for delete" onclick="return confirm('Sure to Delete?')"><i class="fa fa-trash-o"></i> Remove</a></td>
    </tr>
  </tbody>
</form>

这是我的btnchange.php代码,这就是我用来获取prod_id的{​​{1}}代码和qty输入的内容。

btnchange.php

shopcart.php

1 个答案:

答案 0 :(得分:0)

您不能将查询参数放在ft=lambda x: ((x**4)*math.exp(x)/(((math.exp(x))-1**2)) # ^ This parenthesis is never closed. 属性中。您需要改用隐藏的action

input