Does anyone know how to get the Enviroment
Variables so one can know if it's null,( and

might be cool to print them tOo!)
So you can know when to bypass calling StdIn
because if there's no data, the CGI just

stalls and times out,

It really revolves something like around
pQuery = getenv("QUERY_STRING");

if (pQuery != NULL)

I'm using POST though instead of QUERY_STRING, though

Basically so I don't need a seperate html
page for data entry

Here's what I did in a C cgi





Thank Andy

Posted on 2001-11-20 09:37:18 by andy981
Posted on 2001-11-20 09:39:34 by andy981
There is the GetEnvironmentVariable API, but I'm not sure if its what you want.....

Posted on 2001-11-20 09:56:48 by Mirno
invoke GetEnvironmentVariable,ADDR Buffer2,(LENGTHOF
Buffer2 - 1)

This did not work?
But I'm just guessing
Posted on 2001-11-20 10:10:15 by andy981
This code worked for me:

.model flat,stdcall
option casemap:none

include \masm32\include\
include \masm32\include\
include \masm32\include\

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib

env db "PATH",0
buffer db 2048 dup (0)

invoke GetEnvironmentVariable, ADDR env, ADDR buffer, 2048
invoke MessageBox, NULL, ADDR buffer, NULL, MB_OK

invoke ExitProcess, eax
end start

Posted on 2001-11-20 10:37:30 by Mirno
I wrote an example that answers all your questions. Put test.html and cgitest.exe in the same folder and open test.html. The rest speaks for itself.

Posted on 2001-11-20 14:26:56 by Thomas
This is Great, now I can have the post html in the exe it self,
I had to go out earlier, but It had dawned on to me that
Mirno had an idea, I mean Instead of "path" for the string
in variable use "Request Method".

Hopefuly in Time I can build a universal way to get data in,
for CGI's at the moment, I'm just considering numbers in.
But, I was thinking have an array with the addresses of
seperate empty strings, then load the contents of each
field, to be manipulated as needed, In the seperate string variables.
Anyway THanks Thomas, Your definately a Wizard


Posted on 2001-11-20 15:19:31 by andy981
I'm dumb-founded. I guess I should write a FAsm to MASM32 converter.
Posted on 2001-11-20 15:43:34 by eet_1024