Beyond XHTML with CGI

When you invoke a URL that points to a CGI program, the HTTP server starts the program. The server then sends back the program's output as if it were the contents of an XHTML 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 either a text- or image-based representation of the new count as its output. The server sends the data back to the browser just as if it were a real file living somewhere on the server. ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.