
CSc 302 Form Assignment
45 pts |
A Formal Arrangement |
Due: April 11 |
Create a web form. Your form may be for any purpose you like,
though some possibilities are a guest book, an order form for
fictional goods, or a sign-up for a fictional event. Use your
imagination. Here are the requirements:
- Usual boilerplate.
- Use at least five different types of input tag. <textarea> and
<select> can count as one of the five, even though they're not
actually <input> tags.
- Have your form processed on Sandbox. You may use savedat.php
to save data to a file on your server account, or you may write
a processor in PHP if you know how to do that.
- Pay some attention to what is shown after the submit. Don't just
use the savedat.php default. Make something that goes with
you submission page.
Please name your assignment formasst.html and
place your assignment in a forms directory under
local_html. This will allow it to work with savedat.php
if you use that, and won't hurt anything otherwise. Your URL
will work out to
http://sandbox.mc.edu/youraccout/forms/formasst.html.
Using savedat
To use the savedat.php you must:
- Save your form in a directory local_html/forms. Won't work
unless you put your form there.
- Use the action URL
http://sandbox.mc.edu/savedat.php.
- Create a directory formdat under your home directory (not
under local_html).
- Change permissions so the web server can write your data directory.
[test@sandbox test]$ cd local_html
[test@sandbox local_html]$ mkdir forms
[test@sandbox local_html]$ cd ..
[test@sandbox test]$ mkdir formdat
[test@sandbox test]$ chmod a+w formdat
- The data file name is created based on the page name: a page stored
as local_html/forms/mike.html will have
its data stored in formdat/mike_data.txt under the same
user account.
- If you create a file formdat/mike.tmpl it will be used to
build a final display page instead of the default. Its contents
should be HTML, but anything of the form {name},
where name is the name of a data field in the form,
will be substituted for the value. It also takes lines
marked by #ifdef symbol … #endif which are
included or excluded based on the symbol having a non-blank value.
- If you don't have a formdata/mike.tmpl,
and you create an ordinary page at
local_html/forms/mike_resp.html, it will be displayed
after the data is successfully stored.
- In case of an error, or if you don't create a resp file,
savedat.php will
generate its own response page.