• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 28. Programming CGI Scripts > Beyond HTML with CGI

Beyond HTML with CGI

When the URL points to a program, however, the server starts the program. The server then sends back the program's output as if it were a file. What does this accomplish? For one thing, a CGI program can read and write data files (a Web server can only read them) and produce different results each time you run it. This is how page counters work. Each time the page counter is called, it finds the previous count from information stored on the server (usually in a file), increments it by one, and creates a .gif or .jpg file on-the-fly as its output. The server sends the graphic data back to the browser the same as if it were a real file living somewhere on the server.

NCSA Software Development maintains the CGI specification. You'll find the specification —along with other excellent links—online at the World Wide Web Consortium's CGI pages: http://www.w3.org/CGI/. This document goes into great detail, including history, rationales, and implications. If you don't already have a copy, download one and keep it handy. You won't need it to understand the examples in this book, but it will give you a wonderful overview of CGI and help you think through your own projects in the future.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint