O'Reilly logo

Platinum Edition Using XHTML™, XML, and Java™ 2 by Andrew H. Watt, Mike Morgan, Jim O'Donnell, Eric Ladd

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CGI Script Structure

When your script is invoked by the server, the server passes information to the script via environment variables and, in the case of the HTTP POST method, via STDIN. GET and POST are the two most common request methods you'll encounter, and probably the only ones you'll need. The request method tells your script how it was invoked; based on that information, the script can decide how to act. The request method is passed to your script using the environment variable (see "Standard CGI Environment Variables" later in this chapter) called, appropriately enough, REQUEST_METHOD.

  • GET is a request for data, the same method used for obtaining static documents. The GET method sends request information as parameters tacked onto the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required