Details of HTTP URLs
There are times when a static document is not sufficient for the desired purpose. The Web provides a solution in these cases. Rather than depend upon a document in an unchanging file, the Web makes provision to request that the server run a program on the client's behalf. This program can do any of a number of things, including generating HTML "on-the-fly". (This is how a number of the really neat things on the web work--such as navigation bars, guestbooks, forms, and so on--unfortunately, it isn't all that easy to do. There are some canned programs--for specific purposes--that you can use, be we won't be able to detail any of them in this seminar.)
The following URL shows a hypothetical example of a link to such a special-purpose facility:
http://www.fake.com/cgi-bin/program
This looks like a fairly ordinary URL, except that it isn't. The "cgi-bin" part is a clue that a script is involved. The "program" is the name of the program (running on the same machine as the web server program) that does the magic. This program can be written in C, or using a UNIX shell scripting language, or in PERL (which is why we won't be talking about how to do write such programs today.) This can get even more complex:
http://www.fake.com/cgi-bin/program/subdir/file?query
This example adds a path specification beyond the program name: this is for a file (such as a data file) that the program is to use. And the "query" part, after the question mark, "?," is an argument to be passed to the program (such as a serach string).
http://www.fake.com/the-file.html#where
Where the "where" part (following the pound-sign, "#") indicates a (previously-defined) location within the document "the-file.html." We will discuss how to accomplish this on Day 3, but if you want to see how it works, check out the glossary.