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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Sessions Problem

Status
Not open for further replies.

Dynamo3209

Programmer
Joined
Jan 2, 2003
Messages
57
Location
US
Hi,
I am developing a shopping cart, having some problems with the sessions I have 3 files Index.php, addtocart.php and shoppingcart.php(php class file) after selecting the products on index.php page, all the products are displayed on the next page,addtocart.php, for displaying all the products selected with price I am calling the php class shoppingcart.php which handles all the displaying functions. Now after displaying the shopping cart I move on to the next page where user details and some other questions depending on the products selected is asked from the user, however I am not able to access the products selected on the first page, on this page where the users are asked some questions depending upon the products they purchase.
Also while displaying the products selected I have to refresh the page before the products are displayed, if I move ahead from the index page a blank addtocart.php is displayed however when the page is refreshed it displays the correct products selected.
Appreciate any help in this regard.
Thanks,
Dynamo
 
Judging from past and current experience with sessions, you will probably save yourself a lot of time if you can just store this data into a table instead of relying on session data, especially since this is a shopping cart. Wouldn't it be nice to be able to store every item and see what you bought later? Still use the sessions to pass an id or something but keep all your selections in the database.

If you still would rather just go with all the info being passed in the session, post some of your code and let us see if we can get ya going.


-Dustin
Rom 8:28
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top