QUESTION Your book has taught me a lot, but I am running into a problem that it does not cover. I have created a FORM for email and it works fine, but when you push send you are given another FORM to fill out. How do I cause the program to return to the homepage when a person pushes send?ANSWERForms are a bit tricky. The thing to remember is that the form is always processed by a separate program that lives on your computer, usually a "cgi" script. That script has one overriding responsibility; to return some meaningful HTML information as the subsequent page to the form. It can be as simple as a single line of text that says "thanks for your submission; use your BACK button to get back to our site" or it can be a complex and attractive Web page with lots of elements (and perhaps even some of the info you just added with your form).
The second task of the script, the one that makes it interesting, is that it needs to be able to extract the information entered from the stream of data sent by the Web browser, then do something useful or intelligent with it. Simple examples include packaging it up and sending it off as email, or saving a copy in a 'comments' file. More complex examples include performing database searches (where the resultant HTML is the response page you receive), parsing and validating the input and letting the user into a new area of the site, and similar. There are no limits.
![]()