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 AllForms.pl, 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 'is_email.pl',
		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
		printed

--]                                                                  
      
[HEAD][TITLE]Lunch[/TITLE][/HEAD]
[BODY][H1]Lunch[/H1]

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

[p]
[FORM ACTION="http://mathforum.org/htbin/AllForms.pl"
METHOD=POST] [P][PRE]
[b]         Name[/b]: [INPUT VALUE="" SIZE=40 NAME="From"]
[b]       E-Mail[/b]: [INPUT VALUE="" SIZE=40 NAME="from_email"]
[/PRE]
[p]
[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" 
VALUE="full/path/name/for/your.logfile.html"] 
[INPUT TYPE="hidden" NAME="return_file"
VALUE="/full/path/name/for/trailer"]

[INPUT TYPE="hidden" NAME="return_fields"
VALUE="From,order,MayoOrOil,sweet,hot,onions"]
[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
preferences):[br]
[TEXTAREA ROWS=5 COLS=65 NAME="order"][/TEXTAREA][P]

Extras:[br]
Mayo or Oil? [select name="MayoOrOil"]
[option selected]Oil
[option]Mayo
[option]Dry
[/select]
[br]
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
[p]

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

[/FORM]

[Privacy Policy] [Terms of Use]

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

© 1994-2014 Drexel University. All rights reserved.
http://mathforum.org/
The Math Forum is a research and educational enterprise of the Drexel University School of Education.The Math Forum is a research and educational enterprise of the Drexel University School of Education.

15 July 1996