Example #1
0
void LoadEnvironment()
{
    if (cgiReadEnvironment(SAVED_ENVIRONMENT) !=
            cgiEnvironmentSuccess)
    {
        cgiHeaderContentType("text/html");
        fprintf(cgiOut, "<head>Error</head>\n");
        fprintf(cgiOut, "<body><h1>Error</h1>\n");
        fprintf(cgiOut, "cgiReadEnvironment failed. Most "
                "likely you have not saved an environment "
                "yet.\n");
        exit(0);
    }
    /* OK, return now and show the results of the saved environment */
}
Example #2
0
int cgiMain() {
#if DEBUG
	/* Load a saved CGI scenario if we're debugging */
	cgiReadEnvironment("/home/boutell/public_html/capcgi.dat");
#endif
	cgiHeaderContentType("text/html");
	fprintf(cgiOut, "<HTML><HEAD>\n");
	fprintf(cgiOut, "<TITLE>cgic test</TITLE></HEAD>\n");
	fprintf(cgiOut, "<BODY><H1>cgic test</H1>\n");
	Name();
	Address();
	Hungry();
	Temperature();
	Frogs();
	Color();
	Flavors();
	NonExButtons();
	RadioButtons();
	fprintf(cgiOut, "</BODY></HTML>\n");
	return 0;
}