您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php实现购物车数量更新的代码一例

2024/3/19 17:18:22发布28次查看
<?php /** * php购物车 处理代码 * edit bbs.it-home.org */ require 'config.inc.php'; //配置文件 require 'checklogin.php'; //登录检测 $username = $_session['username']; $action = $_get['action']; switch ($action) { case "edit_num": $arr = $arr = $_post['suliang']; foreach($arr as $key=>$value){ $sqlgx = "update `cartemp` set suliang='$value' where username='".$username."' and flag=0 and sp_id='".$key."'"; mysql_query($sqlgx, $conn); echo "<script>location.href='shopcat.php'</script>"; } break; case "null": $null_sql = "delete from `cartemp` where username='$username' and flag=0 "; mysql_query($null_sql, $conn); echo "<script>location.href='shopcat.php'</script>"; break; case "del": $id = $_get['id']; $del_sql = "delete from `cartemp` where id=$id"; mysql_query($del_sql, $conn); echo "<script>location.href='shopcat.php'</script>"; break; } ?>
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product