PDA

View Full Version : parameter transfer in CGI with C


wind0965
02-03-2004, 02:44 PM
One question, I wrote in C (save as "test.cgi")
static int psTest()
{
char* option;
int flag;
option = getenv("QUERY_STRING");
if(option != NULL)
sscanf(option,"%d",&flag);
...
}

and in JavaScript:
var test_cgi = 0;
"test.cgi?" + test_cgi;

But I can not receive the test_cgi as parameter in C. That is flag is always 13784, and option is "*\p001". Do you have any idea?

Thank you!