A
Anonymous
Guest
After some though, I think I've come up with an idea about how to do my shopping cart.
Until one of my "Add To Cart" buttons is pressed, I don't need to do anything. When an "Add To Cart" button is pressed, I will get the user's IP address. With the IP address, I will look for a file name on my server - the file name will be the IP address plus "cart" or something like that.
If the file doesn't exist, create it and add the PartNumber, Description, Quantity, Price and shipping cost. If the file does exist, just add append the new item.
When the View Cart or Checkout button is pressed, I simply go to the script that creates a nice <Table> with all the data and a SubTotal and Total_With_Shipping. The user can then go to the script that sends me their infomation.
After all the shopping is done, another script is run that will delte any .cart files that are older than a certain age - which I will specify in code.
Does this look reasonable? I'm going this way because I'm just getting into PHP. I don't know about cookies and sessions yet.
Do you see any problems with this idea?
Until one of my "Add To Cart" buttons is pressed, I don't need to do anything. When an "Add To Cart" button is pressed, I will get the user's IP address. With the IP address, I will look for a file name on my server - the file name will be the IP address plus "cart" or something like that.
If the file doesn't exist, create it and add the PartNumber, Description, Quantity, Price and shipping cost. If the file does exist, just add append the new item.
When the View Cart or Checkout button is pressed, I simply go to the script that creates a nice <Table> with all the data and a SubTotal and Total_With_Shipping. The user can then go to the script that sends me their infomation.
After all the shopping is done, another script is run that will delte any .cart files that are older than a certain age - which I will specify in code.
Does this look reasonable? I'm going this way because I'm just getting into PHP. I don't know about cookies and sessions yet.
Do you see any problems with this idea?