home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 May / APC452.ISO / netkit / xitami / xitami.exe / TESTCGI1.C < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-19  |  1.5 KB  |  43 lines

  1. /*  ----------------------------------------------------------------<Prolog>-
  2.     Name:       testcgi1.c
  3.     Title:      CGI test program
  4.     Package:    Xitami web server
  5.  
  6.     Written:    96/10/01  Pieter Hintjens <ph@imatix.com>
  7.     Revised:    97/04/29  Pieter Hintjens <ph@imatix.com>
  8.  
  9.     Synopsis:   Generates an HTML test page containing the arguments passed
  10.                 to the CGI process.
  11.  
  12.                 To build this program you must download the SFL package from
  13.                 www.imatix.com.
  14.  
  15.     Copyright:  Copyright (c) 1997 iMatix
  16.     License:    This is free software; you can redistribute it and/or modify
  17.                 it under the terms of the XITAMI License Agreement as provided
  18.                 in the file LICENSE.TXT.  This software is distributed in
  19.                 the hope that it will be useful, but without any warranty.
  20.  ------------------------------------------------------------------</Prolog>-*/
  21.  
  22. #include "sfl.h"
  23.  
  24. int
  25. main (int argc, char *argv [])
  26. {
  27.     /*  Generates full HTTP header
  28.      *
  29.      *  This should be passed through the server transparently
  30.      *  Some servers require that the CGI program be named 'nsp-'.
  31.      *  Xitami detects the HTTP header automatically.
  32.      *  Note that this will not work with the Keep-Alive option enabled,
  33.      *  since the content-length is not specified.
  34.      */
  35.     puts ("HTTP/1.0 200 Ok");
  36.     puts ("Content-Type: text/html");
  37.     puts ("");
  38.     puts ("<HTML>");
  39.     puts ("<BODY>Test program 1</BODY></HTML>");
  40.  
  41.     return (EXIT_SUCCESS);
  42. }
  43.