next up previous
Next: Details Up: Form Processing Previous: Validating User Input (Bonus

Processing an Order

  (Note that even if you are not doing the bonus part, you will need to read the product file as in the form generation stage.) A valid order should be appended to a file called orders.dat. An order consists of several lines written out to the file with the following format:
{name}
{street-address}
{city}:{state}:{zip-code}
{intended-use}
{username}
{encrypted-password}
{order-line-1}
...
{order-line-n}
%%

Notice that city, state, and zip code are separated by colons. Intended use is either Commercial or Noncommercial. You can encrypt the password by calling the Perl builtin function crypt. Use the text to be encrypted as the first argument, and pass the string "bx" as the second. A person's order ends with two percent signs. An order line is of the following form:

{product-code}:{quantity}

The script should then generate a page containing a purchase summary for the user. The <TITLE> of the page should be Order Summary for {name} where {name} is the name input by the user. It should have the following format:


next up previous
Next: Details Up: Form Processing Previous: Validating User Input (Bonus
Louis Ziantz
4/23/1998