What I would recommend is, for each "session" create a random ID and store
it in the person's cookie. Then, have a "session" table(s) in your
database. For every book they choose, dump the unique ID of the book in the
session table with the user's session number. Do that for any other
tracking you need to do. After they logout, clear out the session data (if
you want to). Also have a nightly(hourly, etc.) program that runs on that
table to clear out expired sessions (you'll keep track of the last time the
session was used. If it is older than 15 minutes, clear them out and force
log ons).
To do it correctly, there is a lot of work and data to keep track of. Sort
of a tough application for being new to a language.
Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "Peter Iksan" <peterik@s...>
To: "professional php" <pro_php@p...>
Cc: <pro_php@p...>
Sent: Wednesday, July 04, 2001 9:16 PM
Subject: [pro_php] Fw: Kok diem aja...?
> Dear All,
>
> I'm just a beginner in PHP, so I know a little about PHP.
> I would like to make a online shop, but I have some problems as follows :
>
> 1. I have to set a cookies that contains member id ( that can be randomly
> generated), code of the book that will be bought, and the sum of the
> purchase.
> 2. Keep that cookies in a database
> 3. When the user had finished their shopping, read the database for the
> record with the same member id. Base upon information that gathered from
the
> databse, calculate and display the sum of purchase and also display the
> title the books.
>
> Altough it's much easier doing it with sessions, but session is not
allowed.
> Maybe it's alittle bit weird, but I have to program with cookies.
>
> Any help would be greatly appreciate.
>
> Thank's
> Peter
>
>
>
>