Assignment 4: HTML Forms and Perl

100 points

Part 1 HTML Forms (35 points)

Make sure that you've worked through the HTML Forms Tutorial prior to starting this part of the assignment.

  1. Download the form from http://garnet.acns.fsu.edu/~kbaldauf/cgi-bin/guestbook.html and save it on your own computer.
  2. Edit the guestbook to use on your own Web site:
    • Change all name references to your own
    • Ask your guests for information that you are interested in. Include at least one textbox, radio button set, checkbox, and dropdown list other than those (or in addition to those) provided in the example guestbook.

As an alternative, you may decide to use a form for some other purpose on your Web site. Make sure that whatever form you decide to create, you include the elements taught:

  • form tag (5 points)
  • textbox (5 points)
  • radio button set (5 points)
  • checkbox (5 points)
  • dropdown list (10 points)
  • submit button (5 points)

Name your HTML file after your FSU username.

Part 2 Server-side Scripting with Perl (65 points)

After you have completed the Perl Tutorial, you will have a working guestbook in your own cgi-bin directory on garnet. Your task for this assignment is to create your own Web form and Perl script in your cgi-bin directory. You will use the form you created in part 1 of this assignment. Follow the steps below:

  1. Upload your HTML form to your cgi-bin directory and change its permissions to 755.
  2. Make a copy of the guestbook.cgi file in your cgi-bin directory and give it a new name. Here's how
    1. Use SSH Secure Shell Client to access the garnet command line.
    2. Change to your cgi-bin directory
    3. Use the following command to copy guestbook.cgi with a new name
      cp guestbook.cgi username.cgi (use your username for the new name)
    4. Change the permissions of the new file to 755
      chmod 755 username.cgi
    5. Edit the form tag in your HTML file so that it references your cgi file as was done in the guestbook.html file.
      <form name="anyname" method="post" action="http://garnet.fsu.edu/cgi-bin/cgiwrap/~your_username/your_username.cgi">
    6. Edit your cgi/Perl program to work with the data sent from your HTML form. Also change the name of the datafile (in your .cgi program) from guestbook_data.csv to your_username_data.csv

Your program should:

  • Be original in its purpose/implementation (10 points)
  • Gather the variables sent from your form (10 points)
  • Send you an email notification that includes some data submitted by the form (15 points)
  • Write the form data and current date/time to a datafile in your cgi-bin directory (15 points)
  • Send attractive and useful HTML output back to the browser that includes the data submitted in the form (15 points)

Submission

Your three files your_username.html, your_username.cgi, your_username_data.csv will be graded from your cgi-bin directory. Submit the A4 form on the Assignments page of our class Web site. Make sure to check your page and links from http://garnet.acns.fsu.edu prior to submitting the assignment form indicating that you have finished.