Next: Details
Up: Form Processing
Previous: Validating User Input (Bonus
(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:
- A
<H1>
heading Order Summary for {name}
where
{name}
is the name input by the user.
- A horizontal rule (
<HR>
).
- A
<H2>
heading that reads Contact Information:
.
- An appropriate label in bold and the user's street address.
- The user's city, state, and zip code with appropriate bold
labels on the same line.
- A horizontal rule (
<HR>
).
- A
<H2>
heading that reads Other Information:
.
- An appropriate label in bold and the user's intended use for
the software.
- An appropriate label in bold and the user's username.
- The text
Password successfully logged.
in bold.
- A horizontal rule (
<HR>
).
- A
<H2>
heading that reads Purchase Information:
.
- One or more lines indicating the items ordered. Each line
should consist of the product name, the quantity, and the item's
price (commercial or noncommercial) with appropriate bold labels.
- An appropriate label and the total number of items ordered.
- An appropriate label and the total due. Note that total due
is computed based on the number of items ordered and the
price of each item (either commercial or noncommercial
based on the intended use of the software).
Next: Details
Up: Form Processing
Previous: Validating User Input (Bonus
Louis Ziantz
4/23/1998