Current location: Hot Scripts Forums » Programming Languages » PHP » add items a la shoppingcart


add items a la shoppingcart

Reply
  #1 (permalink)  
Old 01-15-05, 12:14 AM
nassau nassau is offline
Wannabe Coder
 
Join Date: May 2004
Posts: 211
Thanks: 0
Thanked 0 Times in 0 Posts
add items a la shoppingcart

i'm trying to make a page where the user can select (checkbox) items from a list. i want the selected items to be displayed on the following page when user hits submit. on that following page there will be a new list of items. i want the user to be able to select items from that lst too and ADD them to the list of selected items.

sort of like a shopping cart. only problem is, i don't know how to create the forms and PHP code for this. i'm sure it's pretty simple but i just can't make it work.


thanks for any help!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 01-15-05, 04:17 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by nassau
sort of like a shopping cart. only problem is, i don't know how to create the forms and PHP code for this. i'm sure it's pretty simple but i just can't make it work.
Why do people who ask for assistance always claim that the code they want someone else to write for them is "simple"? If it's so simple, why don't they do it?

Seriously, doing web forms that have persistent information etc etc isn't brain surgery, but it's not "simple". Simple is "Hello World".
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 01-15-05, 06:22 PM
nassau nassau is offline
Wannabe Coder
 
Join Date: May 2004
Posts: 211
Thanks: 0
Thanked 0 Times in 0 Posts
why do people misread and misquote? i said "i am sure is pretty simple", meaning it's hard for me but might be simple for those who know how to do it.

anyone who knows how to do this is most welcome to help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 01-15-05, 10:21 PM
moronovich moronovich is offline
Junior Code Guru
 
Join Date: Oct 2004
Posts: 460
Thanks: 0
Thanked 0 Times in 0 Posts
hi nassau, maybe we can talk about this when i get back online at my messenger
__________________
just an ignorant noob with moronic solution...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 01-16-05, 10:33 AM
Klesti Klesti is offline
Newbie Coder
 
Join Date: May 2004
Location: Albania
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
You can do it using SESSIONS

So take a look at sessions.

PHP Code:



//Shoping cart example 

session_start();

//Lets supose $_SESSION['shop_cart'] is the array of shopping cart and $item is the item passed from another script

array_push($_SESSION['shop_cart'], $item); 

//To show the shoping cart just work with the array $_SESSION['shop_cart'];

while (list($key$val) = each($_SESSION['shop_cart'])) {
    echo 
"$key => $val\n";

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 01-21-05, 02:52 AM
nassau nassau is offline
Wannabe Coder
 
Join Date: May 2004
Posts: 211
Thanks: 0
Thanked 0 Times in 0 Posts
thanks Kleisti and Moronovich (i'll talk to u on YIM, already emailed u about this before i read this thread again).

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vote / Poll - need User able to add new entries jsabarese Script Requests 2 11-30-04 01:33 AM
Need Epinions-lite system in PHP & MYSQL wali001 Job Offers & Assistance 4 01-12-04 07:02 AM


All times are GMT -5. The time now is 06:42 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.