| 
    Исходный текст программы infocgi.c
     | 
   
  
    | Оглавление | 
    Назад 
    // ==========================================
// infocgi.c
//(C) Alexandr Frolov, 1998
// E-mail: frolov@glasnet.ru
// Web:    http://www.glasnet.ru/~frolov 
// ========================================== 
    #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
void main(int argc, char *argv[])
{
  char tmbuf[9];
  char datbuf[9];
  char * szMethod;
  char szBuf[200];
  char szBuf1[200];
  int  nInDatasize;
  szMethod = getenv("REQUEST_METHOD");
  if(!strcmp(szMethod, "POST"));
  {
    nInDatasize = atoi(
      getenv("CONTENT_LENGTH"));
    fread(szBuf, nInDatasize, 1, stdin);
    szBuf[nInDatasize - 1] = '\0';
    sprintf(szBuf1, "Server date: %s %s ",
    _strdate(datbuf), _strtime(tmbuf));
    strcat(szBuf1, szBuf);
    printf(
      "Content-type: text/plain\r\n\r\n");
    printf(szBuf1);
  }
}
     
     | 
   
 
 |