hi everyone. I'm putting a simple shopping cart together that emails order on the 
checkout. Below is the logic of how it works and I was wondering if something could be 
simplified (especially the number of pre existing conditions for the whole thing to 
work, which are: user must accept cookies and run JavaScript)?

1. script sets a cookie (if it doesn't exist yet) with a random 5 digit number as a 
value - $value
2. opens a file (or creates one if it doesn't exist) with the name - $filename = 
f.$value
3. writes the part number of the ordered item into the file
4. at the same time JavaScript opens a window asking: "continue shopping or checkout?" 
(this is a part I don't like since there is no connection between the cgi script and 
this message - it pops up regardless if the script did its job or if there were 
errors. Maybe I should place the JavaScript at the end of the perl script in the HTML 
tags and execute only after the script runs successfully?)
5. if "continue" the pop-up message will simply close, if "checkout":
checkout.cgi will read the value of the cookie, open the f$value file and send its 
contents back to the browser asking for the rest of the data (name, phone, etc..) and 
email everything on submit.

Thanks for any suggestions. This mlist is great and I'm amazed by everyone's 
altruistic help.
Mariusz

Reply via email to