I am doing a shopping cart which was working OK until I put the instruction
at the end of the email form which sends the email order to the shop.
Now the value for the cookie has disappeared AND IT REFUSES TO SET A NEW COOKIE.
I emptied the shopping cart AND cleared the cookies off the computer.
The output to the code below is:
Any ideas please?
Code:
//delete cookie
setcookie("cartId");
at the end of the email form which sends the email order to the shop.
Now the value for the cookie has disappeared AND IT REFUSES TO SET A NEW COOKIE.
I emptied the shopping cart AND cleared the cookies off the computer.
The output to the code below is:
Code:
echo $sql;
gives the output:
insert into cart(cookieId, ITEMID, QTY,COLOR,SIZE) values ('', 1247001, 5, '' ,'')
Any ideas please?
Code:
include("db.php");
// Get a connection to the database
$cxn = mysql_connect($dbServer, $dbUser, $dbPass, $dbName) or die
(mysql_error());
$db = mysql_select_db("oscart", $cxn) or die(mysql_error());
$sql = ("insert into cart(cookieId, ITEMID, QTY,COLOR,SIZE) values
('" . GetCartId() . "', $ITEMID, $QTY, '$COLOR' ,'$SIZE')") or die(mysql_error
());
//look at sql
echo $sql;
ShowCart();