#!/usr/local/bin/perl # webscr - web cgi routine to emulate PayPal shopping cart # # Dave Stoddard - 5/29/04 # dgs@accelix.com # # Copyright # --------- # Copyright(c) 2004, Accelix LLC. All Rights Reserved. # # Description # ----------- # This program adds items to the shopping cart. It recognizes the following # parameters (an asterisk indicates the parameter is required): # # itemno (*) : item number (e.g., item1234) # quantity (*) : quantity (whole numbers only) # price (*) : price (in dollars and cents: 11.99) # title (*) : item title (shows on invoice) # optname1 : option name 1 (e.g., color) # optval1 : option value 1 (e.g., red) # optname2 : option name 2 # optval2 : option value 2 # optname3 : option name 3 # optval3 : option value 3 # # These parameters can be embedded inside a form, or can be passed as a # string of parameters as part of the URL. # # RCS Information # --------------- # $Id$ # $Log$ # # package main; use strict 'vars'; use strict 'subs'; # use warnings; # use diagnostics; # load application modules use cart; # shopping cart support routines # --------------------------- # DECLARATIONS AND PROTOTYPES # --------------------------- # local elements my %form = (); # data from form (name/value pairs) my %state = (); # state persistence data hash ### ### START PROGRAM ### # initialize the program %form = ReadForm (); # read the form %state = GetState (%form); # get current state data (cookies) AddCartItem (%form,%state); ExitProgram (); ### End Main Program ###