[an error occurred while processing this directive]

Perl

Menu

In-class assignment #9

In this assignment, you will write a small CGI program in Perl.

Create a Perl CGI script to ask the user for their name and favorite color. The first time your script is loaded, it displays a form. Provide a text box for the user to type their name, and three radio buttons for the user to choose their favorite color. Provide a submit button.

When the user hits your submit button, your script is loaded again. When parameters are passed to your script, retrieve the user's name and favorite color. Print out an HTML response, that includes "Hello <name>" in an h1 tag. Set the background color of the response page equal to whatever color the user chose from the radio buttons.

For a bonus half-point, include three checkboxes on the form. Label them "bold", "italic", and "underline". When the user user submits the form, print out the current date at the end of your HTML response (use scalar(localtime()) to obtain it. Format the date with whichever format options the user checked (keeping in mind that the user might check 0, 1, 2, or all 3 of them).

Note

Do NOT hardcode the name of your script anywhere within your script. Use the default action of the startform() function, so that your script points to itself.

Submission Instructions

To submit, run ~lallip/public/submit.pl on solaris.cs.rpi.edu. You may submit infinite times, only the last submission is graded. Your final submission is due at 4pm today, Thursday, April 15, 2010.

Perl Quotes
Perl Quotes