/* Author: Ram Samudrala (me@ram.org) * * March 1, 1997. * Caveats: the strings "title", "final", etc. must match those in the * form. * A more sophisticated submission form can be written. * */ #include "cgi_common.h" #include "cgi_defines.h" #include "cgi_error_handlers.h" #include "cgi_display.h" #include "trivia.h" int content_type_displayed = FALSE; void read_trivia_file(char filename[], int trivia_data[MAX_ENTRIES][NUM_OPTIONS]); /******************************************************************/ int main() { int number_of_entries, i; entry entries[MAX_ENTRIES]; FILE *answer_fp; char filename[STRING_LENGTH], buf[STRING_LENGTH]; check_method("POST", "main"); check_content_type("main"); sprintf(filename, "%s.%d", TMP_FILENAME_STRING, (int) getpid()); open_file(&answer_fp, filename, "w", "main"); fprintf(answer_fp, "Subject: %s submission\n\n\n", TRIVIA_GAME_NAME); number_of_entries = read_entries(entries); for(i = 0; i <= number_of_entries; i++) { if (strstr(entries[i].name, "title") != NULL) fprintf(answer_fp, "
Assuming the format of your submission was okay, your question should\n"); printf("be up on the page shortly.
\n"); display_signature(); return TRUE; } /******************************************************************/