HTML and CSS Reference
In-Depth Information
9.12. Forms Programming
If you create forms, sooner or later you'll need to create the server-
side application that processes them. Don't panic. There is nothing magic
about server-side programming, nor is it overly difficult. With a little
practice and some perseverance, you'll be cranking out forms applica-
The most important advice we can give about forms programming is easy
to remember: copy others' work. Writing a forms application from scratch
is fairly hard; copying a functioning forms application and modifying it to
support your form is far easier.
Fortunately, server vendors know this, and they usually supply sample
forms applications with their server. Rummage about for a directory
named cgi-src , and you should discover a number of useful examples you
can easily copy and reuse.
We can't hope to replicate all the useful stuff that came with your server
or provide a complete treatise on forms programming. What we can do
is offer a simple example of GET and POST applications, giving you a feel
for the work involved and hopefully getting you moving in the right dir-
Before we begin, keep in mind that not all servers invoke these applica-
tions in the same manner. Our examples cover the broad class of serv-
ers derived from the original National Center for Supercomputing Applic-
ations (NCSA) HTTP server. They also should work with the very pop-
ular and public-domain Apache server. In all cases, consult your serv-
er documentation for complete details. You will find even more detailed
information in CGI Programming with Perl , by Scott Guelich, Gunther
Birznieks, and Shishir Gundavaram, and Webmaster in a Nutshell , by
Stephen Spainhour and Robert Eckstein, both published by O'Reilly.
One alternative to CGI programming is the Java servlet model, covered
in Java Servlet Programming , by Jason Hunter with William Crawford
(O'Reilly). Servlets can be used to process GET and POST form submis-
Search WWH ::

Custom Search