Chapter 11: Forms
(Web Input Processing)

Ingredients:

  • A Web form through which the user can provide input
  • The Common Gateway Interface (CGI) for processing that input on the server
  • Returning output to the user

Many people are satisfied after the main course and rarely eat desserts. For others, no meal is complete without a dessert. Here we learn how to make your basic dessert.


Examples

Note: These examples are not live, but include sample HTML and code from the printed book for you to download. But you can see similar scripts in action elsewhere at this site!

11.2.1 - A Simple Example
A basic form. This is just the HTML code.
AppleScript Example
An AppleScript by Joshua Baer for creating a new message in Claris Emailer Lite and queuing it for delivery. See also Table 11-4.
Frontier scripting example.
A sample Frontier script that changes the name of any file in a folder that ends in .htm to end in .html. See also Table 11-5.
11.5.1 - AppleScript: An E-mail Submission
This form is set up to use the email.cgi AppleScript by Eric Lease Morgan.
11.5.2 - Frontier: Soliciting Feedback
This Frontier script will let you interpret a basic feedback form to create a simple guestbook.
11.5.3 - Perl: An Automated Archive
Filling out this HTML form will let you post job information to update a Web page using this MacPerl script (text-only).


Table 11-1 An Example of Overcoming Stateless Web Interaction

Product Description
Biotech Validation Suite by Ton Rullmann and Jurgen Doreleijers An example of overcoming the Web's stateless interaction.
Biotech Validation Suite by Ton Rullmann and Jurgen Doreleijers UK mirror site for example of overcoming Web's stateless interaction.

Table 11-2 Tutorials for Writing Web Forms

Product Description
Forms Tutorial by Carlos Pero An interactive tutorial.
HTML Forms by W3 Consortium The official specification.
WebCom Forms Guide by WebCom A good tutorial.

Table 11-3 Tutorials on CGI Programming

Product Description
CGI programming by Anne Foxworthy A general overview.
CGI resources by Yahoo! CGI tutorials and resources.
CGI Tutorial by Mike Smith CGI tutorial, with Unix examples.

Table 11-4 AppleScript and the CGI

Product Description
AppleScript by Apple The scripting language included with the Mac OS can be used for CGIs.
AppleScript for Scripters by Apple The official AppleScript reference.
AppleScript for the Internet by Ethan Wilde Using AppleScript for the Internet.
AppleScript Sourcebook by Bill Cheeseman A repository of information on AppleScript.
CGIs with AppleScript by Jon Wiederspan A CGI and AppleScript tutorial for WebSTAR.
Josh's AppleScript Pages by Joshua Baer Includes example scripts and glossary.
Scripting Additions by ScriptWeb Scripting additions for writing AppleScript applications and CGIs.
Scripting information by Late Night Software A source of AppleScript info, including a list of scriptable applications.
ScriptWeb by Martin Fenner, et al. A good overview Macintosh scripting, including AppleScript and other languages.

Table 11-5 Frontier Scripting Sources

Product Description
CGI with Frontier by Mason Hale Frontier for CGIs.
Frontier by Userland Frontier 5.0.1 is the most recent free version.
Frontier CGI Shop by Timothy Paustian Another third-party tutorial for Frontier CGIs.
Frontier FAQ by Francois Granger About three years old.
Frontier mailing lists by various  
Frontier Samples by Userland Various scripting samples.
Frontier tutorial by Diana Cassady A third-party tutorial.
Frontier-related bookmarks by Aron Roberts A list of Frontier resources.
Serious First Steps in Frontier Scripting by Brent Simmons  
The Outpost by Dave Solko A third-party Frontier resource.

Table 11-6 Information on Perl

Product Description
Macintosh Perl info by O'Reilly Perl modules for Macintosh.
MacPerl by Matthias Neeracher How to download and install Perl for the Macintosh.
Perl libraries by Web Developer's Virtual Library Collection of useful links to Perl resources, including libraries.
Perl.com by O'Reilly The official source of all things Perl.

Table 11-7 Perl Libraries for CGI Programming

Product Description
MacPerl scripts by various Source of some MacPerl scripts.
Perl and the Web by Roy Fielding libwww-perl Mailing List Archives.
Perl links by Paul Schinder List of MacPerl related links and scripts, including Mac ports of libwww-perl and other useful libraries.
Perl Web libraries by various Summaries of the more popular Perl libraries for the Web.

Table 11-8 E-mail Submission of Form Input

Product Description
Email.cgi by Eric Morgan An AppleScript CGI for sending form input via e-mail.
Flexmail by NetDreams An inexpensive form-to-email utility that works as a WebSTAR plug-in.
Forms.acgi by Steve Johnson A CGI script in C for sending form input via e-mail.

Table 11-9 Canned CGIs and Forms Tools

Product Description
FormSaver by Pliner Solutions A server plug-in that takes form information and saves it as a tab-delimited file.
Interaction by Media Design in Progress Interaction lets you create and manage dynamic, social Web sites with threaded discussions, chats, and shopping.
Mail-file by Lutz Wiemann AppleScript CGI that allows clients to request files be sent to them via e-mail.
NetCloak Pro by Maxum Development NetCloak Pro includes the forms processing functions of NetForms.
Upload by Net Dreams A plug-in for WebSTAR 1.3.2 or higher. It allows a webmaster to accept files uploaded from users' Netscape browsers.
Web Crossing by Lundeen & Associates A CGI application to provide Web-based discussion boards and forums.

Table 11-10 Information on Cookies

Product Description
Andy's HTTP Cookie Notes by Andy Kington A tutorial on cookies.
Cookie Central by Cookie Central A comprehensive resource on cookies.
Cookie demos by Cookie Central Examples of using cookies through CGI scripts.
Cookie issues by Yahoo! Links to articles on the privacy and security issues raised with cookies.
Cookie resources by Yahoo! Links to resources from Yahoo!
Cookie source code by Andy Kington Source code in AppleScript, Frontier, and MacPerl.
Persistent Client State HTTP Cookies by Netscape The cookie specification from Netscape.