The boing demon
CGI stands for Common Gateway Interface.
CGI prorams were intended as a way to pass information
back and forth between a http server and a different system
like gopher or wais.
Like all other URLs, the URLs that provide the
of an embedded image
can point to a CGI program that (for example) generates
the image on the fly:
The client can't tell the difference between this dynamic case
and the static case where the server reads the data from a static
file; to your browser, it's all just a stream of typed data.
- The http server executes the CGI program;
- the CGI program prints something on standard
output that starts with a header saying ``this document is an
image,'' and continues with the raw image data.
- The http server then passes the program's output on to the client,
- and the client displays it as an image.
This is how
some people implement counters in their pages: the counter is
a gif that displays a number; the program that produces the
gif counts (e.g. in a file) how many times it has been invoked,
and draws that number as an image. (HTML has no
provisions to include dynamically created text in a page;
but images are always possible.)