int main(void)
{
char *lenstr;
char input[MAXINPUT], data[MAXINPUT];
long len;
//printf("%s%c%c\n\n","Content-Type:text/html;charset=iso-8859-1",13,10);
printf("Content-Type:text/html\n\n");
printf("\n");
printf("\n
Response\n\n");
printf("\n");
lenstr = getenv("CONTENT_LENGTH");
if(lenstr == NULL || sscanf(lenstr,"%ld",&len)!=1 || len > MAXLEN)
printf("
Error in invocation - wrong FORM probably.
\n");
else {
FILE *f;
fgets(input, len 1, stdin);
unencode(input EXTRA, input len, data);
f = fopen(DATAFILE, "a");
if(f == NULL)
printf("
Sorry, cannot store your data.
\n");
else
fputs(data, f);
fclose(f);
printf("
Thank you! Your contribution has been stored.
\n");
}
printf("
\n\n");
return 0;
}