Putting It All Together
Let's say that you would like to create a simple questionnaire for one of your Web pages. For example, you would like to ask for the reader's name, sex, age and comment, and then process it in a CGI script. The HTML form might live in a file named http://computer.howstuffworks.com/survey.htm and look like this:
HSW Survey Form
Click on this URL to see the form in action: http://computer.howstuffworks.com/survey.htm.
The CGI script referenced by this form will receive four different pieces of data: the name, age, sex and comment of the reader who submits the form. The script will have to parse out the four values and handle all of the character transformations. The file http://computer.howstuffworks.com/survey.c was used to create the script survey.cgi and is perhaps 100 lines long.
HSW Survey Form
Click on this URL to see the form in action: http://computer.howstuffworks.com/survey.htm.
The CGI script referenced by this form will receive four different pieces of data: the name, age, sex and comment of the reader who submits the form. The script will have to parse out the four values and handle all of the character transformations. The file http://computer.howstuffworks.com/survey.c was used to create the script survey.cgi and is perhaps 100 lines long.

0 Comments:
Post a Comment
<< Home