Lesson 5 - Forms & Scripts

HTML documents range in complexity from simple, static postings to dynamic, user modified pages. A static document never changes unless the author personally makes changes. Hyper links in a document can direct the browser to additional information. Form objects within an HTML document allow a browser to submit information to the author, raising the level of interaction between the browser and the HTML document. Via an intermediate program known as a CGI script, the WEB site can do many things with the submitted information. The data can be e-mailed to someone who needs to know about the submission (for admissions to a university program, for example). Or, the data can be processed and passed on to a local executable program for further analysis (for obtaining a 3D model for a protein, for example). Finally, the data can be used to generate a new, custom designed HTML document that is sent back to the user (for requesting multiple sequence data and reporting the results, for example).

There are two mechanisms by which data can be submitted from a client to a server. The first, called GET, places the data from each form item into an appropriate ENVIRONMENT VARIABLE, as defined and supported by the SERVER software. The second, called POST, places a stream of input data into the SERVER computer's STANDARD INPUT BUFFER.

For a script to access this information, it must either read the environment variables, or the standard input buffer. Generally, the POST method is more secure, so that is what we will deal with in this course.

When a client presses the SUBMIT button of a form, it tells the SERVER computer to run the appropriate script. In our case, we tell Nowlisten to run a batch file, which takes care of local environments, and calls the appropriate script program. The scripts that I have worked with are written in PERL, for Practical Extraction and Report Language.

Assignment 5

To get started in your introduction to PERL scripts, first examine the kinds of forms that one can make (consult the links listed below). Then, using the form action "http://www.bmb.psu.edu/cgi-bin/597_1996/return.bat", create and test some of your own forms. By placing this action in your form, when you submit your entered data, you will be presented with a verbatum list of the input data, and how it can be parsed into the appropriate variables and their values. To see what I mean, check out this example. After you have learned some of what can be done with forms, make an HTML document in which you:

Potentially Useful links:

Return to Table of Contents