Monday, October 5, 2015

Fedora httpd CGI programming

When the necessary is done, do take note that the 'gcc xxx.c -o xxx.cgi' must be done in the folder that the file will be executed.


It depends on the scripting or programming language used how a program can access the value of an environment variable. In the C language, you would use the library function getenv (defined in the standard library stdlib) to access the value as a string. You might then use various techniques to pick up data from the string, convert parts of it to numeric values, etc.


The output from the script or program to “primary output stream” (such as stdin in the C language) is handled in a special way. Effectively, it is directed so that it gets sent back to the browser. Thus, by writing a C program that it writes an HTML document onto its standard output, you will make that document appear on user’s screen as a response to the form submission.


No comments:

Post a Comment