1) Improving the quality of the catalog
2) Soliciting a form of payment
3) Using a secure server
4) Transitioning to a scripted, rather than an "ad hoc" system
1. Improving the Catalog
If you have visited commercial sites, you know that there are a variety
of things that can be done to improve on a simple list of products. Some
of the things I have observed include:
2. Soliciting Payment. Once your customer has submitted an order, you will need to ask for payment. Give them a choice of Visa, Mastercard or American Express, via radio buttons. The first two are 16 digit numbers which begin with 4 (Visa) or 5 (Mastercard.) American Express numbers are 15 digits long and begin with 37. (There are a few exceptions, but for now, this is what we'll accept.)
Your software should accept credit card numbers in a variety of formats, such as
4444 5555 3333 2022 (that is, with spaces in it)
4444-5555-3333-2222 (that is, with dashes or other separator characters.)
Eliminate all non-numeric characters, then check to see if the number has the right number of digits and starts with the right digits for the card type previously specified.
Expiration dates are specified by month and year. Check to see that the expiration date is in the future (not already expired.)
3. Secure Server. I will attempt to negotiate for a secure server, because I think you folks would benefit from the experience. If I do not succeed, then you should use the regular CGI service provided by nemesis.
If we do succeed, you will link to whatever URL we are using, with the href="https://" protocol instead of the usual http.
4. Scripted System. This is the toughest part of the assignment to describe to you, and probably the toughest to verify, too. Your catalog is to be specified by two documents:
A: The catalog form, which is a text document containing embedded special
tags; and
B: A price list file, specifying the cost of each item.
There is a third file which contains
C: The inventory (which you already programmed for Lab 2.)
The intention of the project is that your lab should be set up so that the CGI code itself does not contain any information about the company's products. That info is all in the form, and in the price table. This makes it possible for you to put up two completely different companies, using the same basic script (with two names.) Your order form will be "streamed" from a source document, through the server, combined with the inventory file and a price table, and will appear as a full HTML form. Then, a company owner would only have to edit the source document and the price table, to change their line of merchandise.
Inventory. In this Lab 3, unlike Lab 2, do not display the available
inventory count (you don't see professional sites doing that, do you?)
However, you will display on items which have 0 inventory, a message (perhaps
in red text): TEMPORARILY OUT OF STOCK. Items which have, for instance,
5 in stock, and the person orders 6 of them, will be back-ordered as they
were before. That is, you sell the customer 5 of them and tell them that
the remaining unit will be shipped and billed when available.
And so that is how you will demo the fact of your system's scripted
behavior.
A) Put up your main company, and provide me a URL for it.
B) Put up a second company ("perhaps its the "Outlet Mall" of your main store). It only has to sell two products, since its only purpose is to show me your script with different data. You can use a second copy of your script(s), with a different name.
C) Print out your script, order form's HTML-plus-tags, and price list. You will hand me this printout, together with the URL, at the final exam of the course. This is how I will determine the internal operations of your script.
Your script should be laid out and commented like a professional program. By now you folks know what is expected of maintainable, legible code. This is the only time I'll see your source code, so make it pretty and make it easy to read.
DUE DATE: Tuesday 28 April, at Exam Time.
Extra Credit Item:
You can of course think up all kinds of extra things to do. One thing
which is very nice, is to use sendmail and send the customer an
e-mail acknowledgement of their order. It should contain the same itemization
that you provided them on their summary page.