September 2002
Intermediate to advanced
544 pages
13h 6m
English
This is a simple example of a form handling program written in C. It accepts user input submitted through a form, and prints the values that the user entered. The source code for the program appears in Listing 11.2.
1: #include <stdio.h> 2: #include "cgic.h" 3: 4: void print_name(); 5: void print_secure(); 6: void print_operating_system(); 7: void print_browser(); 8: 9: int cgiMain() { 10: cgiHeaderContentType("text/html"); 11: fprintf(cgiOut, "<html><head>\n"); 12: fprintf(cgiOut, "<title>C Example</title></head>\n"); 13: fprintf(cgiOut, "<body><h1>C Example</h1>\n"); 14: print_name(); 15: print_secure(); 16: print_operating_system(); 17: print_browser(); 18: fprintf(cgiOut, "</body></html>\n"); ... |
Read now
Unlock full access