** Start of listing of h3b.cc ** /* How did I build h3-cc.cgi? */ #include #include #include "CGI-cc.h" // Warning, that's not a header, it's the whole file!! int main() { CGI c; // Contains all the CGI info. See CGI-cc.h for access methods. char* br = "
"; char* nl = "\n"; char* qs; char* fn; char* ln; char* fav; qs = getenv("QUERY_STRING"); c.start_html("Robert Maas CalRobert642@Yahoo.com", "Test CGI Page- written using C++ Include file", "white"); std::cout << "The query string is: [" << qs << "]" << br << nl; if ((fn = c.copy_value("firstname")) == NULL) { cout << "Your form doesn't contain any [firstname] field." << br << nl; } else if ((ln = c.copy_value("lastname")) == NULL) { cout << "Your form doesn't contain any [lastname] field." << br << nl; } else if ((fav = c.copy_value("favorite number")) == NULL) { cout << "Your form doesn't contain any [favorite number] field." << br << nl; } else { cout << "Do you prefer to be called '" << fn << " " << ln << "'" << br << nl << "or rather '" << ln << ", " << fn << "' ?" << br << nl; cout << "And is your favorite number really " << fav << " ?" << br << nl; } c.end_html(); } ** End of listing of h3b.cc ** Here is the directory entry for that source file: -rw------- 1 rem user 1212 Feb 9 2007 h3b.cc ^ Note user execute permission *not* needed for source files. That gets compiled to a.out, but then renamed to something.cgi so that it will be usable by remote users via CGI: -rwx------ 1 rem user 11237 Jul 12 2005 h3-c++.cgi ^ Note user execute permission needed for all CGI programs. (because compiled-C++ is native machine code running directly on machine)