The code that follows was used to build this lunch-ordering form. There is an explanation of what is demonstrated here.

Back to Form Explanation Page

[!--  This form activates the script, which responds to
the following fields:

From 		- name of submitter
from_email	- email address of submitter
Answer		- answer given by submitter

response	- Text for written page

logfile		- File to write log to
		If its sent, it must be an existing, writable file available
		to the group http.  New log entries will be appended in html
log_fields	- fields to be written to log
return_file	- file to add to text returned to stdout
return_fields	- fields to add to  text sent to stdout
		a comma-delimited list.  The ':pre' postfix will
		cause the output to be put in [PRE] [/PRE] tags

to_email	- email address of moderator
		If you don't want email, don't include this field
email_subject	- subject on email sent to moderator
email_fields	- fields to send to moderator (given by 'to_email')
		If you specify a to_email but leave this out, it will send
		everything except to_email, xxx_fields, logfile, return_file
		and response.
script		- an auxiliary script to run must be
                in the directory given by $script_dirs
                ($SCRIPT_DIR = "/usr/local/lib/httpd/form.scripts"; ?)
script_fields	- fields to pass via stdin to the script
		a comma delimited list of field names to be
		sent to the stdin of the script.  One field per line,
		in the format 'fieldname:value', with the 'answer' field,
		if requested translatin invisible characters (newline,
		carriage return, tab) to '\n','\r',and '\t' so the value
		fits on one line.
			Plain text can be included in the input to the script
		by single quoting it: e.g.
			to_email, 'this is text', email_subjects
required_fields - fields required for the submission to be processed
                fields required for the input to be processed
                for length ] 0 on all but 'from_email' where it checks
		the value using the function 'is_email' in '',
		whatever tha happens to be
required_error_page - Page to show if all 'required_fields' are not filled
			If this field exists, this page will be shown if
		all of the required fields aren't filled.  If this field
		isn't specified, a very simple list of missing fields is


Please use this form to submit your lunch orders each day.  Try to get them
in by about 10:30 or so.  Thanks!

[b]         Name[/b]: [INPUT VALUE="" SIZE=40 NAME="From"]
[b]       E-Mail[/b]: [INPUT VALUE="" SIZE=40 NAME="from_email"]
[INPUT TYPE="hidden" VALUE="lunch" NAME="email_subject"]
[INPUT TYPE="hidden" VALUE="user@host" NAME="to_email"]
[INPUT TYPE="hidden" NAME="response" VALUE="Thanks for your order! Here's
what you sent me:"]

[INPUT TYPE="hidden" NAME="logfile" 
[INPUT TYPE="hidden" NAME="return_file"

[INPUT TYPE="hidden" NAME="return_fields"
[INPUT TYPE="hidden" NAME="log_fields" VALUE="From,order,MayoOrOil,sweet,hot,onions"]  
[INPUT TYPE="hidden" NAME="email_fields" VALUE="order,MayoOrOil,sweet,hot,onions"]

Please submit your lunch order (including lettuce, tomato and cheese

Mayo or Oil? [select name="MayoOrOil"]
[option selected]Oil
What else?[br]
[INPUT TYPE="checkbox" NAME="sweet" VALUE="yes"] Sweet	[INPUT
TYPE="checkbox" NAME="hot" VALUE="yes"] Hot [INPUT
TYPE="checkbox" NAME="onions" VALUE="yes"] Onions

[INPUT TYPE="submit" VALUE="Submit your answer" NAME="S"]
[INPUT TYPE="reset" VALUE="Start over"][BR]


[Privacy Policy] [Terms of Use]

Home || The Math Library || Quick Reference || Search || Help 

© 1994- The Math Forum at NCTM. All rights reserved.

15 July 1996