Okay, here's a snippet of my program that isn't working right. It's one of the most puzzling programs I've ever come across, and it's driving me crazy.
Basically, with certain query strings, I can't call strstr (or many other string functions) on the pointer buffer. I have no clue why; for instance, it works when the first part of the query string is "searchString=and" but it doesn't work with "searchString=not". It works if I try a different type of search with the program. Anyway, it's hard to describe; the web page is set up here:
http://compsci.mwsc.edu/~lgn8316/hmwk07/
And here's a snippet from the beginning of my search.cgi program:
Basically, with certain query strings, I can't call strstr (or many other string functions) on the pointer buffer. I have no clue why; for instance, it works when the first part of the query string is "searchString=and" but it doesn't work with "searchString=not". It works if I try a different type of search with the program. Anyway, it's hard to describe; the web page is set up here:
http://compsci.mwsc.edu/~lgn8316/hmwk07/
And here's a snippet from the beginning of my search.cgi program:
code:<HR>Code:int main(int argc, char *argv[],char *env[]){ cout << "Content-type: text/html\n\n" << endl; cout << "<HTML><HEAD><TITLE>Environment</TITLE></HEAD><BODY>"; cout << "<H1>Query String</H1>"; cout << "<H2>Original String</H2>" << endl; char *buffer; buffer = getenv("QUERY_STRING"); cout << "[" << buffer << "]" << endl; char searchCode; if(strstr(buffer,"searchString")) searchCode='a'; else if(strstr(buffer,"startMonth")) searchCode='d'; else searchCode='n';