3/21 Monday 5 pm. Notice that the lab is closed after 3/16
You are going to write a very simple CGI program. The CGI program compute the total cost of your books. If there is some invalid input, the program will print out warning message in red and ask for new input.
Here is how your webpage look like
Charles Bookstore |
The user type in the quatity of the books. The final price is calculated, for example if 2 Learning Perl and 3 Perl in a Nutshell are bought.
|
You bought 2 Learning Perl and 3 Perl in a Nutshell. |
If the user choose yes to the membership and enter a valid membership number
Then, the use get 10% discount. The output is
|
You bought 2 Learning Perl and 3 Perl in a Nutshell. |
So far, my bookstores have only 9 members, here are their 9-digit membership number:
111222333,222333444,333444555,444555666,555666777,666777888,777888999,123456789, 987654321
When the user input invalid data, then a warning message in red will be given.
Charles BookstoreSorry, we cannot process your request due to the following reasons: |
There is nothing to submit. The grader is going to check your webpages
http://www.pic.ucla.edu/~YourUserName/hw6/index.html.
You should name your CGI program book.cgi. You have to chmod 711 book.cgi.
You will get zero point if your CGI file is readable by other people.
Don't forget to put your honesty pledge inside your html file (between <body> and <body/>)
<!-- Name: Charles Li Student ID : 000 000 000 PIC ID: ccli E-mail: ccli AT math DOT ucla DOT edu Assignment: hw1 I, Charles Li, pledge that this is my own independent work, which conforms to the guidelines of academic honesty as described in the course syllabus. -->
and in your cgi file add
# Name: Charles Li # Student ID: 000 000 000 # PIC ID: ccli # E-mail: ccli@math.ucla.edu # Assignment: hw1 # # I, Charles Li, pledge that this is my own independent work, which # conforms to the guidelines of academic honesty as described in the course # syllabus.