--- libaitwww/example/test.c 2012/03/09 09:38:55 1.1.2.1 +++ libaitwww/example/test.c 2012/03/09 10:03:21 1.1.2.2 @@ -6,8 +6,8 @@ int main() { - int i; - cgi_t *cgi; + int ret; + cgi_t *cgi, *cgi1; putenv("QUERY_STRING=test1=abra+kadabra&testche=piuk%20mdaa"); putenv("CONENT_LENGTH=390"); @@ -18,17 +18,26 @@ main() return 1; } - /* - printf("%s\n%s\n", cgigetvalue("something"), cgigetvalue("somethingelse")); - cginewquerystr("blaha=this is a string&blahb=this is another string"); - printf("\n%s\n%s\n", cgigetvalue("blaha"), cgigetvalue("blahb")); + printf("%s\n%s\n", www_getValue(cgi, "testche"), www_getValue(cgi, "test1")); + cgi1 = www_parseQuery("blahA=this is a string&blahB=this is another string"); + if (!cgi1) { + printf("Error:: #%d - %s\n", www_GetErrno(), www_GetError()); + www_closeCGI(&cgi); + return 2; + } + printf("\n%s\n%s\n", www_getValue(cgi1, "blahA"), www_getValue(cgi1, "blahB")); - cgiclose(); - cginewquerystr("tmpa=another kool string&tmpb=and again"); - printf("\n%s\n%s\n", cgigetvalue("tmpa"), cgigetvalue("tmpb")); - i=mail("John-Mark Gurney ", "John-Mark Gurney ", "Test", "this is a test, $tmpa and other junk $tmpb"); + www_closeCGI(&cgi); + + www_addValue(cgi1, "oho", "boho"); + printf("\n%s\n", www_getValue(cgi1, "oho")); + www_delPair(cgi1, "oho"); + /* + printf("\n%s\n", www_getValue(cgi1, "oho")); + www_delPair(cgi1, "oho"); */ - www_closeCGI(&cgi); + www_closeCGI(&cgi1); + return 0; }