CS 312 - Internet Concepts
Fall 2011: Tues/Thurs 3-4:15pm, Dragas 1117

Print - Admin

Announcements

Staff

Schedule

Syllabus

Useful Links

CGI Lab Exercises

October 6, 2011

Setup

Create a new directory ~/public_html/cs312/labs for your lab exercises and set the permissions so that it the web server (anyone) can access it (chmod 755 ~/public_html/cs312/labs).

Create a webpage named cgi-lab.html for today's lab exercises under ~/public_html/cs312/labs. You can use this single webpage for all of today's exercises. Don't forget to set the permissions on the webpage as well (chmod 644 ~/public_html/cs312/labs/cgi-lab.html).

Submission

As you complete each lab exercise, let me know and I'll come check it out.

Lab Exercises

1) Query Strings

Create links that display search results on the following sites for Toy Story 3:

  1. http://www.bing.com
  2. http://www.imdb.com
  3. http://search.twitter.com

For each of these, also display the URL pattern needed to construct the search. The URL should be the shortest version that works.

2) Form Design

Add a music survey form similar to the example shown below.

Be creative -- you don't have to replicate the example exactly, but be sure to include all of the form elements listed below:

  • text boxes for name and email address
  • check box group with at least 3 choices
  • radio button group with at least 3 controls
  • select box that initially shows 3 items but contains at least 4 items
  • scrolling text box (textarea) that is 60 characters wide and 3 rows high
  • submit button
  • reset button

Notes:

  • Use a table to organize your form.
  • Place your group members' names at the bottom of the page.
  • (Hint: Draw a sketch of your form and the table before you begin coding the XHTML.)

3) Form Submission

Now, connect the Submit button of the form you created in part 2 to http://www.htmlcodetutorial.com/cgi-bin/mycgi.pl.

Write the answers to the following questions on your webpage:

  1. What are the differences you find between using the GET method and the POST method for submitting the form?
  2. How does the information from the form get to the server?
  3. What happens when it gets to the server?
  4. Where does the page that your browser displays (after pressing 'Submit') come from?