添加按钮不会添加"数量,它只重新加载页面

时间:2018-03-25 06:52:25

标签: php html

enter image description here

我无法弄明白,谢谢你的阅读  我多次编辑代码但总是以相同的结果结束

这是代码(html):

<input type="number" size="2" title="Input value" placeholder="0" id="doni" 
name="Value"  required maxlength="4"onKeyDown="limitText(this,4);" />

<input type="submit" value="+" name="button" title="Add" onclick =action 
="addQuan.php"/>

 <?php
 include('connect.php');
 $id = $_POST['memi'];
 $a = $_POST['code'];
 $b = $_POST['bname'];
 $c = $_POST['Value'];
 $d = $_POST['price'];
 $e = $_POST['supplier'];
 $f = $_POST['qty_left'];
 $i = $_POST['dname'];
 $t = $f + $c;
 $sql = "UPDATE products 
 SET qty_left=? 
 WHERE product_id=?";
 $q = $db->prepare($sql);
 $q->execute(array($t,$id));
 header("location: products.php");?>

0 个答案:

没有答案