Bontiv-Sourceer source code viewer
Root | Help
./web-crawler/src/cgi/main.c
#include <stdio.h>
#include <stdlib.h>
#include "cgi.h"

int main(int argc, char* argv[])
{
  int i;
  char buff[100];
  char* env = malloc(1000);

  puts("Content-Type: text/plain");
  puts("");
  env = getenv("QUERY_STRING");
  if (env != NULL)
    puts(env);

  puts("page>>");
  env = get_param("page");
  if (env)
    puts(env);
  puts("<<page");

  puts("Arguments");
  for (i = 0; i < argc; i++)
    {
      printf("ARG%d: %s\n", i, argv[i]);
    }

  puts("\nContent");
  while(!feof(stdin))
    {
      fgets(buff, 100, stdin);
      puts(buff);
    }

  return 0;
}
Presented with Bontiv-Sourceer