CPSCI 105: Explorations in Computer Science
Lab 16
April 10, 2007
Preliminaries
-
Log in to your account on warp
and make public_html your working directory.
-
Create a directory named forms in the working directory.
Set its protections so that the web server can access it.
-
Make forms your working directory.
-
Use the following command to copy two files from
the directory /home/public/web-authoring to your working directory:
cp /home/public/web-authoring/form* .
(Don't forget the dot—it's part of the bash command—it's not a period.)
-
Set the protections on your form* files so that they're
readable over the web.
-
Open your warp homepage in your
favorite browser; modify the
URL
in the address bar to open the file
the file form-test.html that's
now in your forms directory.
-
If the page doesn't display in your browser, check the following:
Is the URL correct?
Is everything in the URL spelled correctly?
Are the permissions set correctly on the forms directory?
Are the permissions set correctly on the form* files?
-
Enter the requested information and click on the appropriate
button to submit the form for processing. The browser should load
a web page displaying a table of what it could read from your form.
If it doesn't, call me over and we'll figure out what the problem is.
-
Go back to the webpage containing the form and clear it,
using the button at the bottom of the page. Submit the
empty form. Note any differences in the table displayed
in response to your form.
Duckett's examples
We'll do this part together.
It is extremely important that you follow these instructions exactly.
-
Do a pwd to make sure that your forms directory
is the working directory. If it's not, make it so.
-
The examples from your textbook are currently mounted on our
web server. We're going to create a shortcut to them so that
they'll appear to be located in a subdirectory of your forms
directory. (That way, you'll be able to access them easily for
editing and testing purposes.)
-
Issue the following bash command:
ln -s /var/www/html/duckett/ch06_code/ duckett
-
Remember that although the examples appear to be in your filespace,
you don't own them. You can modify them in emacs, but to save your
work, you'll have to do a "save as" into your forms directory.
(Note: if they open into a "read only" buffer in emacs, you can edit
the buffer by giving the command C-x % .)
Forms
The primary purpose of the form-test.html file
is to give you the URL
of the CGI program that
we'll be using to process the forms we'll be making in class.
Today we'll discuss:
- the action and method attributes of the form element
- the difference between the name and id attributes of the input element
- the label element
- textbox, radio button, and submit/reset controls
[ Return to the CPSCI 105-01 homepage ]
Brian J. Rosmaita <contact me>
This page was last modified Tuesday, 10 April 2007 at 16:55 UTC.