【发布时间】:2015-05-17 13:19:05
【问题描述】:
更新购物车中的产品时出现错误。
注意:C:\xampp\htdocs\ecommerce\cart.php行109
中数组到字符串的转换/p>
第109行是指下面代码中的这一行输入包含this['qty']数量的输入类型。
<?php
function updatecart(){
global $con;
$ip=getIp();
if(isset($_POST['update_cart'])){
foreach($_POST['remove'] as $remove_id){
$delete_product="delete from cart where p_id='$remove_id' AND ip_add='$ip'";
$run_delete = mysqli_query($con, $delete_product);
if($run_delete){
echo "<script>window.open('cart.php','_self')</script>";
}
}
}
} if(isset($_POST['continue'])){
echo "<script>window.open('index.php','_self')</script>";
}
【问题讨论】:
-
第 109 行是哪一行?
-
(顺便说一句:您的
UPDATE和DELETE查询存在SQL 注入漏洞)。