...

View Full Version : Give me a solution



dev
01-06-2007, 10:39 AM
i have developed a shopping cart page.
whenever i add a item to the cart i will insert the details into the database table .
but i force the user to login to proceed with the shopping.

The problem is whenever a user logins and continues shopping there will nt be a pblm because i have the Customerid maintained in the database table.

But whenever defaultly i add an item before logging in how can i track the details if some other user tries to add in the same manner.

please provide me a solution ASAP.

thanks
Dev

bostjank
01-06-2007, 11:05 AM
You can store temporal information in a cookie. Or in a server session.

dev
01-06-2007, 11:13 AM
can u please explain it more.
i am gettng stuck up in doing wth that part.
every time if its logd in or not i am adding it to a databse table then .
if i login and add then its nt a pblm for me bcaz i hv the custid.
bt if not .

bostjank
01-06-2007, 11:29 AM
Generate a temporal CustomerID and save it in a cookie (persistent or session). If a user is not logged it, then assign the purchase to this temporal ID. Then, when the user logs in, just check whether there exists temporal ID and update the database records with the true ID of that specific customer.

dev
01-06-2007, 11:41 AM
thanks for the solution.but one more doubt will ths work when multiple users browse the same page.

bostjank
01-06-2007, 12:07 PM
Yes. When a user comes to the site assign her a unique ID and store it in a cookie. As each of the users will have their own ID, it doesn't matter how many user browse your site at the same time.

dev
01-06-2007, 12:14 PM
thank you .I am trying with the same.

dev
01-06-2007, 12:16 PM
can i go with sessionid for uniqueId.

bostjank
01-06-2007, 12:21 PM
Yes. The only prerequisite for temporal ID is that it is unique and that you can read its value.

dev
01-06-2007, 01:16 PM
thank you for the solution and i have done with the work.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum