Basic HTML version of Foils prepared 2 Sept 1997

Foil 18 CGI Program Output: the response to the web server

From CGI Programming with Advanced Topics Jackson State University Mississippi -- Fall Semester 97. by Nancy McCracken *

All output written by the CGI program to STDOUT is taken by the server to process. The output should start with a header in one of three types:
  • Location: the server sends another file to the client (and terminates connection).
  • print "Location: http://www.some.box.com/the_other_file.html";
  • Status: The server will return a status message to the client (and terminates connection).
  • print "Status: 305 Document moved\n";
  • Content-type: The server sends all remaining output to the client (after the mandatory blank line!), terminating only when the script does.
  • print "Content-type: text/html\n\n";



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Sep 2 1997