每次我点击添加购物车按钮我都会传递一个id值并从数据库中获取数据,我想保存一个会话数组。
<?php session_start() ?>
<?php require 'config.php' ?>
<?php
if (isset($_POST['id'])) {
$sql = "SELECT product_name, product_price FROM products WHERE id=".$_POST['id'];
$result = $mysqli->query($sql) or die($mysqli->error);
$result = $result->fetch_assoc();
if (isset($_SESSION['cart'])) {
if (isset($_SESSION['cart']['id'])) {
unset($_SESSION['cart']['id']);
}
}
$_SESSION['cart']['id'] = $result;
$cart = count($_SESSION['cart']);
//$cart = json_encode($_SESSION['cart']['id']);
echo $cart;
}
?>
答案 0 :(得分:1)
尝试这样的事情:
.no-scroll::-webkit-scrollbar {display:none;}
.no-scroll::-moz-scrollbar {display:none;}
.no-scroll::-o-scrollbar {display:none;}
.no-scroll::-google-ms-scrollbar {display:none;}
.no-scroll::-khtml-scrollbar {display:none;}
section {
...
overflow-x: scroll;
-ms-overflow-style: -ms-autohiding-scrollbar;
}