#include #include #include #include "cgi.h" #define MAX_ENTRIES 10000 typedef struct { char *name; char *val; } entry; char *spreadText(char *str); char *makeword(char *line, char stop); char *fmakeword(FILE *f, char stop, int *len); char x2c(char *what); void unescape_url(char *url); void plustospace(char *str); void missing_entry(char * entry); int main(int argc, char *argv[]) { entry entries[MAX_ENTRIES]; register int x,m=0; int cl, count; FILE *dataFile; printf("Content-type: text/html%c%c",10,10); if(strcmp(getenv("REQUEST_METHOD"),"POST")) { printf("This script should be referenced with a METHOD of POST.\n"); exit(1); } if(strcmp(getenv("CONTENT_TYPE"), "application/x-www-form-urlencoded")) { printf("This script can only be used to decode form results. \n"); exit(1); } cl = atoi(getenv("CONTENT_LENGTH")); for(x=0;cl && (!feof(stdin));x++) { m=x; entries[x].val = fmakeword(stdin,'&',&cl); plustospace(entries[x].val); unescape_url(entries[x].val); entries[x].name = makeword(entries[x].val,'='); } /* for(count = 0; count < (x-1); count++) { printf("

%s - %s

", entries[count].name, entries[count].val); } */ printf("
The title of the paper is %s\n\n", entries[0].val);

  printf("Author");
  if(strcmp(entries[3].val, "")) {
    printf("s");
  }
  printf(":\n");

  count = 1;

  while(count < 6) {
    if(strcmp(entries[count].val, "")) {
      printf("%d. %s\n", (count/2), entries[count++].val);
      printf("   %s\n", entries[count++].val);
    }
    else
      count = count + 2;
  }

  printf("\nPresentation format is: %s", entries[count].val);
  if((!strcmp(entries[count++].val, "an oral presentation") && (strcmp(entries[count].val, "No")))) {
    printf(" (You will present as a poster if this is not available)");
  }
  count++;
  printf("\n");
     
  if(strcmp(entries[count+1].val, "\0")) {
    printf("You have suggested %s as a suitable length of time for this paper", entries[count++].val);
    if(strcmp(entries[count+1].val, "")) {
      printf(", with the following rationale:\n\n%s\n", entries[count++].val);
    }
  }

  if(strcmp(entries[count].name, "otherTopic")) {
    printf("Your topics are:\n\n  %s", entries[count++].val);
    while(strcmp(entries[count].name, "otherTopic")) {
      printf(", %s", entries[count++].val);
    }
    if(strcmp(entries[count].val, "\0")) {
      printf(", %s", entries[count].val);
    }
    count++;
    printf(".\n\n");
  }
  
  if(strcmp(entries[count].name, "otherAudioVisual")) {
    printf("Your have the following audio-visual requirements:\n\n  %s", entries[count++].val);
    while(strcmp(entries[count].name, "otherAudioVisual")) {
      printf(", %s", entries[count++].val);
    }
    if(strcmp(entries[count].val, "\0")) {
      printf(", %s", entries[count].val);
    }
    count++;
    printf(".\n\n");
  }

  printf("You submitted the following abstract about your paper:\n\n%s\n\n", entries[count].val);
  printf("
\n"); return 1; }