hello.
Im having a problem with the cart session. What I want to do is kill it after sending the customer info.
I have three pages: the product page, shopping cart page(contains the class cart) and the add to cart page.
heres a part of the code:
shoppingcart page:
<?
session_start();
if(!isset($HTTP_COOKIE_VARS['scid'])) {
$session = md5(uniqid(rand()));
setcookie("scid", $session, time() + 3600);
} else {
$session = $HTTP_COOKIE_VARS['scid'];}
class Cart {
blah
blah
function destroy(){
session_unset();
session_destroy();
}
}
add to cart page:
<?
include("shoppingcart2.php");
$cart = new Cart;
switch($action){
case "add_item":
blah
case "add_cust":
$cart->add_customer(customer, $session, $POST["fname"]."".$POST["lname"], $POST["p1"]."".$POST["p2"]."".$POST["p3"],$POST["email1"]."".$at."".$POST["email2"],$POST["address1"],$_POST["address2"]);
$cart->destroy();
break;
blah
I dont know why im not able to destroy the session.
I tried to set the cookie again:
setcookie("scid", $session, time() - 3600);
to expire it. but i got a warning : Warning: Cannot send session cache limiter - headers already sent (output started a....
Please help.