Re: [PHP] Session for creating a unique shopping cart for each user

2003-10-31 Thread pete M
why use a cookie - the $_SESSION is itself a cookie I'd code it like if (!isset($_SESSION['cart_id'])) { // code to get cart_id $_SESSION['cart_id'] = $cart_id; } include(db) include(products) Tore E. Mackay wrote: Don't realy know. Here is what I have: 1. An index.php that inc

Re: [PHP] Session for creating a unique shopping cart for each user

2003-10-31 Thread Gareth Williams
Do you see any information in your browser before the error appears? Perhaps you could also do a view source from the browser to see if anything has been sent out. On Friday, Oct 31, 2003, at 16:06 Europe/Amsterdam, Tore E. Mackay wrote: Don't realy know. Here is what I have: 1. An index.php

Re: [PHP] Session for creating a unique shopping cart for each user

2003-10-31 Thread Tore E. Mackay
Don't realy know. Here is what I have: 1. An index.php that inculdes products.php if $file=products.php. 2. products.php includes db.php that contains databse connection and the code for creating a session. 3. When I click "add product" $file=cart.php and cart.php includes the db.php file that sho

Re: [PHP] Session for creating a unique shopping cart for each user

2003-10-31 Thread Gareth Williams
Have you already sent anything to the browser? Once the first echo has been performed, you can't send header information, as the header is sent with the first bit of text. On Friday, Oct 31, 2003, at 15:47 Europe/Amsterdam, Tore E. Mackay wrote: Hi, I am creating a shopping cart but experien

[PHP] Session for creating a unique shopping cart for each user

2003-10-31 Thread Tore E. Mackay
Hi, I am creating a shopping cart but experiensing some difficulty in creating unique shopping carts for each user. When I try to create a session I get this error message: Warning: session_start(): Cannot send session cookie - headers already sent This is the code: if(isset($_COOKIE["cartId"]))