[email from 2000-08-17 01:33:37 CDT (Aug Thu) 966494017] Hi, For the web, you can write a certain amount of CGI code in /bin/sh (or any of the other interpreters that can at least handle CGI's somewhat strange input methods), but the workhorse is typically PERL, and most examples will be in that language. C will work just as well as PERL, however, if you don't know the other yet. Note that the HTML output you see in a CGI-generated webpage is -not- the PERL or C or sh code, just the script's HTML output. If you want to do C-based CGI, then just write a program that coughs up the correct initial two lines giving the document type, and use puts() or the like to output HTML. Play with that for a while (it lets you do a whole lot, right there), then find out how the GET and POST actions send their data. I seem to remember that one uses environment variables mostly, so getenv() would be a key function, and the other provides and input stream on stdin of the data from the form, which can be read into a dynamically-allocated buffer with even just getchar(). After that, parsing the input string is a little weird, since you usually want to put the results into a dynamically-allocated vector (remember malloc?) of structs, each with two strings for a name/value pair. Write a function to scan these vector for a named string, and the rest is easy again. So there. :-) ---------------------------------------------------------------------------- C. Alexander North-Keys http://www.talisman.org/~erlkonig/ ------------------------------------------ ^*^ ----------------------------- [when questioned about the following....] | After that, parsing the input string is a little weird, since you usually | want to put the results (got that part) into a"dynamically-allocated vector | (remember malloc?) of structs, each with two strings for a name/value | pair." | | Write a function to scan these vector for a named string, and the rest is | easy again. i.e. typedef struct _NameValuePair { char *name; char *value; } NameValuePair; NameValuePair *pairs; - followed by various functions to fiddle with these, eventually allowing you to do stuff like: char *login = 0, *passwd = 0; if( (login = NvpLookup(pairs, "login")) && (passwd = NvpLookup(pairs, "password"))) { puts("