Processing forms

If you've used the alternative 'get' method of processing forms, there are a few programs that might be available on your web server to help you process the information in QUERY_STRING. The most useful is called cgiparse, and is part of the CERN web server software. This is how you'd call it from a Unix shell script (one of the most popular languages for writing server scripts)

form-name=`cgiparse -value name`

The variable on the left, 'form-name' will be set to the value following 'name=' in the query string returned by your browser. You can call cgiparse as many times as you like to extract all the information you need from the results of the form; there are some other functions too - the administrator of your server should be able to tell you more about it, and what other programs are provided to help manage your scripts.

Scripts that are called using the post method have to read all the information from the form at the beginning; the CONTENT_LENGTH variable is set by the web server to say how much information there is to read. Unfortunately, the details of how you read the information will be different depending on whether you write your scripts in C, Unix shell scripts, Visual Basic or Perl. If you're programming in Perl, a good example of how to do it is the form-mail.pl script.


[ NEXT ][ LAST ][ PART 1 ][ PART 2 ][ PART 3 ]