Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cookie value not being set

Status
Not open for further replies.

mancroft

Programmer
Joined
Oct 26, 2002
Messages
267
Location
GB
I am doing a shopping cart which was working OK until I put the instruction



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();




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top