>Is the string passed to the ci file from a web site null terminated, or does it just END.
String input works the same with CGI as with anything else, both with stdin and arguments to main.
>how do you get it into the file?
The easiest way is to read a string and then parse it. fgets is ideal for this. You can also use argc and argv:
Code:
#include <stdio.h>
#include <stdlib.h>
#define OPEN "<HTML><BODY>"
#define CLOSE "</BODY></HTML>"
int main ( int argc, char **argv )
{
char msg[BUFSIZ];
if ( argc > 1 )
parseMsg ( msg, argv[1] );
printf ( "Content-type: text/html\n\n" );
printf ( "%s\n%s\n%s\n", OPEN, msg, CLOSE );
return EXIT_SUCCESS;
}
-Prelude