Php “清空购物车”按钮无法删除购物车

Php “清空购物车”按钮无法删除购物车,php,html,Php,Html,尝试将此设置为空,并在按下按钮后将购物车更新为空 但它只是在所有物品仍在购物车中的情况下刷新 <?php session_start(); include($_SERVER["DOCUMENT_ROOT"] . "/includes/header.php"); include($_SERVER["DOCUMENT_ROOT"] . "/includes/connection/connection.php"); include($_SERVER["DOCUME

尝试将此设置为空,并在按下按钮后将购物车更新为空 但它只是在所有物品仍在购物车中的情况下刷新

<?php
    session_start();
    include($_SERVER["DOCUMENT_ROOT"] . "/includes/header.php");
    include($_SERVER["DOCUMENT_ROOT"] . "/includes/connection/connection.php");
    include($_SERVER["DOCUMENT_ROOT"] . "/includes/definitions.php");

    $user = $_SESSION['customer_id'];
    $cart_id = $_SESSION['cart_id'];

在取消设置那些$_会话变量之前是否启动了会话?是的,我刚刚添加了一个会话_start();但是,当它刷新购物车时,仍然可以编辑您的问题并添加所有destroy_sessions.php代码吗?
<a href="/cart/destroy_sessions.php"><button id="cart_empty_button">Empty Cart</button> </a>
unset($_SESSION['add_to_cart']);
unset($_SESSION['product_id']);
unset($_SESSION['price']);
unset($_SESSION['quantity']);
echo "<meta http-equiv='refresh' content='0;url=http://sales.prosourceedm.com/cart/view_cart.php'>";