A simple CGI script





The first task is to write a very simple CGI program which just prints out an HTML document. This should include all the usual <head> ... </head> and <title> ... </title> commands. However, there are two things to note.

First of all, the first two lines of the print out are special. The first line must be

Content-type: text/html
so that the browser knows what kind of document it is and therefore how to display it. In this case it is a text document of the subclass HTML. You can also send back plain ASCII documents by using text/plain instead. Sound samples and images also have to have the content type specified appropriately. The second line must be blank (ie it must contain just a line feed). This line is reserved for future development.