If I remember correctly it's very similar to what you do in Perl, only obviously using C commands...

<br><br>So you want to get any user input from the environment, rather than being able to read straight from %ENV as in perl, you'll need to use getenv:<br><br>*note the names of the variables can vary with which HTTP server you are using*<br><br><FONT FACE=monospace>#include <stdlib.h><br><br>char *result = NULL;<br>char *env_name = NULL;<br><br>/* set our env_name to the envirable we want to read */<br>env_name = malloc(sizeof("VARIABLENAME"

;<br>strcpy(env_name,"VARIABLENAME"

;<br>result = malloc(sizeof(getenv(env_name));<br><br>if (result == NULL)<br>{<br> printf("VARIABLENAME doesn't exist\n"

;<br>}<br>else<br>{<br> printf("VARIABLENAME is %s \n", result);<br>}</font><br><br>Then you just write to the page as you would normally, e.g.<br><br><FONT FACE=monospace>/* print http header */<br>fprintf(STDOUT, "Content-type:text/html\n\n"

;<br>fprintf(STDOUT, "blah blah blah....</font><br><br>You can get a list of HTTP/CGI envirables via O'Reilly (webmaster in a nutshell Ch.11, p87 - latest edition)<br><br>Hope that helps<br>Loon<br>